pub trait Client<K: KeyType> {
fn generate_key_complete(
&self,
result: Result<(), ErrorCode>,
unhashed_key: &'static mut [u8],
key_buf: &'static mut K
);
fn append_key_complete(
&self,
result: Result<(), ErrorCode>,
key: &'static mut K,
value: &'static mut [u8]
);
fn get_value_complete(
&self,
result: Result<(), ErrorCode>,
key: &'static mut K,
ret_buf: &'static mut [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
fn generate_key_complete(
&self,
result: Result<(), ErrorCode>,
unhashed_key: &'static mut [u8],
key_buf: &'static mut K
)
fn generate_key_complete(
&self,
result: Result<(), ErrorCode>,
unhashed_key: &'static mut [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
fn append_key_complete(
&self,
result: Result<(), ErrorCode>,
key: &'static mut K,
value: &'static mut [u8]
)
fn append_key_complete(
&self,
result: Result<(), ErrorCode>,
key: &'static mut K,
value: &'static mut [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
fn get_value_complete(
&self,
result: Result<(), ErrorCode>,
key: &'static mut K,
ret_buf: &'static mut [u8]
)
fn get_value_complete(
&self,
result: Result<(), ErrorCode>,
key: &'static mut K,
ret_buf: &'static mut [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
fn invalidate_key_complete(
&self,
result: Result<(), ErrorCode>,
key: &'static mut K
)
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
fn garbage_collect_complete(&self, result: Result<(), ErrorCode>)
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