Struct capsules_extra::tickv::TicKVSystem

source ·
pub struct TicKVSystem<'a, F: Flash + 'static, H: Hasher<'a, 8>, const PAGE_SIZE: usize> { /* private fields */ }
Expand description

TicKVSystem implements KVSystem using the TicKV library.

Implementations§

source§

impl<'a, F: Flash, H: Hasher<'a, 8>, const PAGE_SIZE: usize> TicKVSystem<'a, F, H, PAGE_SIZE>

source

pub fn new( flash: &'a F, hasher: &'a H, tickfs_read_buf: &'static mut [u8; PAGE_SIZE], flash_read_buffer: &'static mut F::Page, region_offset: usize, flash_size: usize ) -> TicKVSystem<'a, F, H, PAGE_SIZE>

source

pub fn initialise(&self)

Trait Implementations§

source§

impl<'a, F: Flash, H: Hasher<'a, 8>, const PAGE_SIZE: usize> Client<8> for TicKVSystem<'a, F, H, PAGE_SIZE>

source§

fn add_mut_data_done( &self, _result: Result<(), ErrorCode>, data: SubSliceMut<'static, u8> )

This callback is called when the data has been added to the hash engine. On error or success data will contain a reference to the original data supplied to add_mut_data(). The possible ErrorCodes are: Read more
source§

fn add_data_done( &self, _result: Result<(), ErrorCode>, _data: SubSlice<'static, u8> )

This callback is called when the data has been added to the hash engine. On error or success data will contain a reference to the original data supplied to add_data(). The possible ErrorCodes are: Read more
source§

fn hash_done( &self, _result: Result<(), ErrorCode>, digest: &'static mut [u8; 8] )

This callback is called when a hash is computed. On error or success hash will contain a reference to the original data supplied to run(). The possible ErrorCodes are: Read more
source§

impl<'a, F: Flash, H: Hasher<'a, 8>, const PAGE_SIZE: usize> Client<F> for TicKVSystem<'a, F, H, PAGE_SIZE>

source§

fn read_complete( &self, pagebuffer: &'static mut F::Page, _result: Result<(), Error> )

Flash read complete.
source§

fn write_complete( &self, pagebuffer: &'static mut F::Page, _result: Result<(), Error> )

Flash write complete.
source§

fn erase_complete(&self, _result: Result<(), Error>)

Flash erase complete.
source§

impl<'a, F: Flash, H: Hasher<'a, 8>, const PAGE_SIZE: usize> KVSystem<'a> for TicKVSystem<'a, F, H, PAGE_SIZE>

§

type K = [u8; 8]

The type of the hashed key. For example [u8; 8].
source§

fn set_client(&self, client: &'a dyn KVSystemClient<Self::K>)

Set the client.
source§

fn generate_key( &self, unhashed_key: SubSliceMut<'static, u8>, key: &'static mut Self::K ) -> Result<(), (SubSliceMut<'static, u8>, &'static mut Self::K, ErrorCode)>

Generate key. Read more
source§

fn append_key( &self, key: &'static mut Self::K, value: SubSliceMut<'static, u8> ) -> Result<(), (&'static mut [u8; 8], SubSliceMut<'static, u8>, ErrorCode)>

Appends the key/value pair. Read more
source§

fn get_value( &self, key: &'static mut Self::K, value: SubSliceMut<'static, u8> ) -> Result<(), (&'static mut [u8; 8], SubSliceMut<'static, u8>, ErrorCode)>

Retrieves the value from a specified key. Read more
source§

fn invalidate_key( &self, key: &'static mut Self::K ) -> Result<(), (&'static mut Self::K, ErrorCode)>

Invalidates the key in flash storage. Read more
source§

fn garbage_collect(&self) -> Result<(), ErrorCode>

Perform a garbage collection on the KV Store. Read more

Auto Trait Implementations§

§

impl<'a, F, H, const PAGE_SIZE: usize> !Freeze for TicKVSystem<'a, F, H, PAGE_SIZE>

§

impl<'a, F, H, const PAGE_SIZE: usize> !RefUnwindSafe for TicKVSystem<'a, F, H, PAGE_SIZE>

§

impl<'a, F, H, const PAGE_SIZE: usize> !Send for TicKVSystem<'a, F, H, PAGE_SIZE>

§

impl<'a, F, H, const PAGE_SIZE: usize> !Sync for TicKVSystem<'a, F, H, PAGE_SIZE>

§

impl<'a, F, H, const PAGE_SIZE: usize> Unpin for TicKVSystem<'a, F, H, PAGE_SIZE>

§

impl<'a, F, H, const PAGE_SIZE: usize> !UnwindSafe for TicKVSystem<'a, F, H, PAGE_SIZE>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> SizedTypeProperties for T

source§

#[doc(hidden)] const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
source§

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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

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

Performs the conversion.