Trait capsules_extra::tickv::KVSystemClient

source ·
pub trait KVSystemClient<K: KeyType> {
    // Required methods
    fn generate_key_complete(
        &self,
        result: Result<(), ErrorCode>,
        unhashed_key: SubSliceMut<'static, u8>,
        key_buf: &'static mut K,
    );
    fn append_key_complete(
        &self,
        result: Result<(), ErrorCode>,
        key: &'static mut K,
        value: SubSliceMut<'static, u8>,
    );
    fn get_value_complete(
        &self,
        result: Result<(), ErrorCode>,
        key: &'static mut K,
        ret_buf: SubSliceMut<'static, u8>,
    );
    fn invalidate_key_complete(
        &self,
        result: Result<(), ErrorCode>,
        key: &'static mut K,
    );
    fn garbage_collect_complete(&self, result: Result<(), ErrorCode>);
}
Expand description

Implement this trait and use set_client() in order to receive callbacks.

Required Methods§

source

fn generate_key_complete( &self, result: Result<(), ErrorCode>, unhashed_key: SubSliceMut<'static, u8>, key_buf: &'static mut K, )

This callback is called when the append_key operation completes.

  • result: Nothing on success, ‘ErrorCode’ on error
  • unhashed_key: The unhashed_key buffer
  • key_buf: The key_buf buffer
source

fn append_key_complete( &self, result: Result<(), ErrorCode>, key: &'static mut K, value: SubSliceMut<'static, u8>, )

This callback is called when the append_key operation completes.

  • result: Nothing on success, ‘ErrorCode’ on error
  • key: The key buffer
  • value: The value buffer
source

fn get_value_complete( &self, result: Result<(), ErrorCode>, key: &'static mut K, ret_buf: SubSliceMut<'static, u8>, )

This callback is called when the get_value operation completes.

  • result: Nothing on success, ‘ErrorCode’ on error
  • key: The key buffer
  • ret_buf: The ret_buf buffer
source

fn invalidate_key_complete( &self, result: Result<(), ErrorCode>, key: &'static mut K, )

This callback is called when the invalidate_key operation completes.

  • result: Nothing on success, ‘ErrorCode’ on error
  • key: The key buffer
source

fn garbage_collect_complete(&self, result: Result<(), ErrorCode>)

This callback is called when the garbage_collect operation completes.

  • result: Nothing on success, ‘ErrorCode’ on error

Implementors§

source§

impl<'a, K: KVSystem<'a, K = T>, T: KeyType> KVSystemClient<T> for TicKVKVStore<'a, K, T>

source§

impl<'a, S: KVSystem<'static, K = T>, T: KeyType + Debug> KVSystemClient<T> for KVSystemTest<'a, S, T>