Skip to main content

Storage

Trait Storage 

Source
pub trait Storage: NorFlash + ReadNorFlash {
    // Required methods
    fn as_slice(&self) -> &[u8];
    fn unlock(&mut self);
}
Expand description

Trait for reading and writing firmware to persistent storage.

Flash is memory-mapped, so as_slice provides zero-copy read access to the app region.

Required Methods§

Source

fn as_slice(&self) -> &[u8]

Direct read access to the app region (zero-copy).

Source

fn unlock(&mut self)

Unlock flash for erase/write. Called once before entering the protocol loop.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§