hcl_compat_uefi_nvram_storage::storage_backend

Trait StorageBackend

Source
pub trait StorageBackend: Send + Sync {
    // Required methods
    fn persist<'life0, 'async_trait>(
        &'life0 mut self,
        data: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageBackendError>> + 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>>, StorageBackendError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Storage backend for accessing the NVRAM

Required Methods§

Source

fn persist<'life0, 'async_trait>( &'life0 mut self, data: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), StorageBackendError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Write data to a non-volatile storage medium.

Source

fn restore<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StorageBackendError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read any previously written data. Returns None if no data exists.

Trait Implementations§

Source§

impl StorageBackend for Box<dyn StorageBackend>

Source§

fn persist<'life0, 'async_trait>( &'life0 mut self, data: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), StorageBackendError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Write data to a non-volatile storage medium.
Source§

fn restore<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StorageBackendError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read any previously written data. Returns None if no data exists.

Implementations on Foreign Types§

Source§

impl StorageBackend for Box<dyn StorageBackend>

Source§

fn persist<'life0, 'async_trait>( &'life0 mut self, data: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), StorageBackendError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn restore<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StorageBackendError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl<T> StorageBackend for &mut T
where T: StorageBackend,

Source§

fn persist<'life0, 'async_trait>( &'life0 mut self, data: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), StorageBackendError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn restore<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StorageBackendError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§