pub struct KeyValueView<F, M>where
F: MultiwriteNorFlash + 'static,
M: RawMutex + 'static,{ /* private fields */ }Expand description
View implementing [umsh_hal::KeyValueStore] on top of a shared
FlashStore. The view itself is essentially a thin pointer; the
real storage lives in the static FlashStore.
Implementations§
Source§impl<F, M> KeyValueView<F, M>where
F: MultiwriteNorFlash + 'static,
M: RawMutex + 'static,
impl<F, M> KeyValueView<F, M>where
F: MultiwriteNorFlash + 'static,
M: RawMutex + 'static,
Sourcepub fn new(storage: &'static FlashStore<F, M>) -> Self
pub fn new(storage: &'static FlashStore<F, M>) -> Self
Construct a KV view over the shared static storage.
Trait Implementations§
Source§impl<F, M> KeyValueStore for KeyValueView<F, M>where
F: MultiwriteNorFlash + 'static,
M: RawMutex + 'static,
impl<F, M> KeyValueStore for KeyValueView<F, M>where
F: MultiwriteNorFlash + 'static,
M: RawMutex + 'static,
type Error = Error<<F as ErrorType>::Error>
Source§async fn load(
&self,
key: &[u8],
buf: &mut [u8],
) -> Result<Option<usize>, Self::Error>
async fn load( &self, key: &[u8], buf: &mut [u8], ) -> Result<Option<usize>, Self::Error>
Load a value into
buf, returning the stored length when present.