Derive Macro vmcore::save_restore::SavedStateRoot

#[derive(SavedStateRoot)]
Expand description

Derives SavedStateRoot for a type.

This ensures that a saved state blob’s metadata can be found, so that it can be used to generate .proto files and perform offline analysis of saved state compatibility.

To use this, you must also derive Protobuf and set a protobuf package for your type. The package name should be defined to group related types together; typically the same package should be used for all types defined in a module.

For example:

#[derive(Protobuf, SavedStateRoot)]
#[mesh(package = "test.my_device")]
struct MySavedState {
    #[mesh(1)]
    active: bool,
}

// This will now compile.
let _blob = SavedStateBlob::new(MySavedState { active: true });