pub trait Client<const L: usize> {
// Required methods
fn add_data_done(
&self,
result: Result<(), ErrorCode>,
data: SubSlice<'static, u8>,
);
fn add_mut_data_done(
&self,
result: Result<(), ErrorCode>,
data: SubSliceMut<'static, u8>,
);
fn hash_done(
&self,
result: Result<(), ErrorCode>,
hash: &'static mut [u8; L],
);
}
Expand description
Implement this trait and use set_client()
in order to receive callbacks.
‘L’ is the length of the ‘u8’ array to store the hash output.
Required Methods§
sourcefn add_data_done(
&self,
result: Result<(), ErrorCode>,
data: SubSlice<'static, u8>,
)
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:
- SIZE: The size of the
data
buffer is invalid
sourcefn add_mut_data_done(
&self,
result: Result<(), ErrorCode>,
data: SubSliceMut<'static, u8>,
)
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:
- SIZE: The size of the
data
buffer is invalid