Trait vmcore::non_volatile_store::NonVolatileStore
source · pub trait NonVolatileStore: Send + Sync {
// Required methods
fn persist<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), NonVolatileStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn restore<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, NonVolatileStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Save and restore hunks of data to a non-volatile storage medium.
E.g: certain devices contain onboard non-volatile storage (e.g: UEFI’s nvram variables, the TPM’s internal state, etc…) that must be persisted across reboots.
This trait provides a generic mechanism for persisting / restoring this kind of non-volatile data, while leaving the details of how it gets stored to supporting infrastructure.