Type Alias TicKVDedicatedFlashComponentType

Source
pub type TicKVDedicatedFlashComponentType<F, H, const PAGE: usize> = TicKVSystem<'static, F, H, PAGE>;

Aliased Type§

struct TicKVDedicatedFlashComponentType<F, H, const PAGE: usize> { /* private fields */ }

Implementations

Source§

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

Source

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

Source

pub fn initialise(&self)

Trait Implementations

Source§

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

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, H, const PAGE_SIZE: usize> Client<F> for TicKVSystem<'a, F, H, PAGE_SIZE>
where F: Flash, H: Hasher<'a, 8>,

Source§

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

Flash read complete.
Source§

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

Flash write complete.
Source§

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

Flash erase complete.
Source§

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

Source§

type K = [u8; 8]

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

fn set_client( &self, client: &'a dyn KVSystemClient<<TicKVSystem<'a, F, H, PAGE_SIZE> as KVSystem<'a>>::K>, )

Set the client.
Source§

fn generate_key( &self, unhashed_key: SubSliceMut<'static, u8>, key: &'static mut <TicKVSystem<'a, F, H, PAGE_SIZE> as KVSystem<'a>>::K, ) -> Result<(), (SubSliceMut<'static, u8>, &'static mut <TicKVSystem<'a, F, H, PAGE_SIZE> as KVSystem<'a>>::K, ErrorCode)>

Generate key. Read more
Source§

fn append_key( &self, key: &'static mut <TicKVSystem<'a, F, H, PAGE_SIZE> as KVSystem<'a>>::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 <TicKVSystem<'a, F, H, PAGE_SIZE> as KVSystem<'a>>::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 <TicKVSystem<'a, F, H, PAGE_SIZE> as KVSystem<'a>>::K, ) -> Result<(), (&'static mut <TicKVSystem<'a, F, H, PAGE_SIZE> as KVSystem<'a>>::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