doc
This commit is contained in:
parent
53c66ff79c
commit
bf89da23a7
|
@ -14,18 +14,21 @@ mod test;
|
|||
|
||||
/// Backend interface for `Store`
|
||||
pub trait StoreBackend {
|
||||
/// type returned by `data()` for reading the flash
|
||||
type Data: ?Sized + AsRef<[u8]>;
|
||||
|
||||
/// Memory-mapped
|
||||
/// memory-mapped
|
||||
fn data(&self) -> &Self::Data;
|
||||
/// size of flash page
|
||||
fn len(&self) -> usize {
|
||||
self.data().as_ref().len()
|
||||
}
|
||||
|
||||
/// error type returned by `erase()`/`flash()` operations
|
||||
type Error;
|
||||
/// erase flash
|
||||
/// erase flash page
|
||||
fn erase(&mut self) -> Result<(), Self::Error>;
|
||||
/// program flash
|
||||
/// program flash with offset into flash page
|
||||
fn program(&mut self, offset: usize, payload: &[u8]) -> Result<(), Self::Error>;
|
||||
/// called after repeated `program()` invocations to allow for eg. cache flushing
|
||||
fn program_done(&mut self) {}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
//! Support for configurations without flash
|
||||
|
||||
use crate::StoreBackend;
|
||||
use core::fmt;
|
||||
|
||||
|
|
Loading…
Reference in New Issue