KeyValueView

Struct KeyValueView 

Source
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,

Source

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,

Source§

type Error = Error<<F as ErrorType>::Error>

Source§

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.
Source§

async fn store(&self, key: &[u8], value: &[u8]) -> Result<(), Self::Error>

Store a value for key.
Source§

async fn delete(&self, key: &[u8]) -> Result<(), Self::Error>

Delete any stored value for key.

Auto Trait Implementations§

§

impl<F, M> Freeze for KeyValueView<F, M>

§

impl<F, M> !RefUnwindSafe for KeyValueView<F, M>

§

impl<F, M> Send for KeyValueView<F, M>
where M: Sync, F: Send,

§

impl<F, M> Sync for KeyValueView<F, M>
where M: Sync, F: Send,

§

impl<F, M> Unpin for KeyValueView<F, M>

§

impl<F, M> !UnwindSafe for KeyValueView<F, M>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.