Trait vmcore::save_restore::SaveRestore
source · pub trait SaveRestore {
type SavedState;
// Required methods
fn save(&mut self) -> Result<Self::SavedState, SaveError>;
fn restore(&mut self, state: Self::SavedState) -> Result<(), RestoreError>;
}
Expand description
Implemented by objects which can be saved/restored
Required Associated Types§
sourcetype SavedState
type SavedState
The concrete saved state type.
Required Methods§
sourcefn save(&mut self) -> Result<Self::SavedState, SaveError>
fn save(&mut self) -> Result<Self::SavedState, SaveError>
Saves the object’s state.
sourcefn restore(&mut self, state: Self::SavedState) -> Result<(), RestoreError>
fn restore(&mut self, state: Self::SavedState) -> Result<(), RestoreError>
Restores the object’s state.