pub struct StorageManager<'f> { /* private fields */ }Expand description
High-level storage manager
Implementations§
Source§impl<'f> StorageManager<'f>
impl<'f> StorageManager<'f>
Sourcepub fn new(flash: &'f mut Flash, config: StorageConfig) -> Result<Self>
pub fn new(flash: &'f mut Flash, config: StorageConfig) -> Result<Self>
Create new storage manager
Sourcepub fn begin_install(
&mut self,
slot: usize,
expected_size: usize,
) -> Result<Transaction>
pub fn begin_install( &mut self, slot: usize, expected_size: usize, ) -> Result<Transaction>
Begin installation to slot (returns transaction)
Sourcepub fn commit_install(&mut self, tx: Transaction, module: &Module) -> Result<()>
pub fn commit_install(&mut self, tx: Transaction, module: &Module) -> Result<()>
Commit installation (mark as valid)
Sourcepub fn status(&self, slot: usize) -> Result<InstallationStatus>
pub fn status(&self, slot: usize) -> Result<InstallationStatus>
Get installation status of slot
Sourcepub fn current_version(&self) -> Result<u64>
pub fn current_version(&self) -> Result<u64>
Get current monotonic version from metadata
Sourcepub fn update_version(&mut self, version: u64) -> Result<()>
pub fn update_version(&mut self, version: u64) -> Result<()>
Update monotonic version (anti-rollback)
Auto Trait Implementations§
impl<'f> Freeze for StorageManager<'f>
impl<'f> RefUnwindSafe for StorageManager<'f>
impl<'f> Send for StorageManager<'f>
impl<'f> Sync for StorageManager<'f>
impl<'f> Unpin for StorageManager<'f>
impl<'f> UnsafeUnpin for StorageManager<'f>
impl<'f> !UnwindSafe for StorageManager<'f>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more