kernel::hil::digest

Trait ClientData

Source
pub trait ClientData<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>,
    );
}
Expand description

Implement this trait and use set_client() in order to receive callbacks when data has been added to a digest.

‘L’ is the length of the ‘u8’ array to store the digest output.

Required Methods§

Source

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

Called when the data has been added to the digest. data is the SubSlice passed in the call to add_data, whose active slice contains the data that was not added. On Ok, data has an active slice of size zero (all data was added). Valid ErrorCode values are:

  • OFF: the underlying digest engine is powered down and cannot be used.
  • BUSY: there is an outstanding add_data, add_data_mut, run, or verify operation, so the digest engine is busy and cannot accept more data.
  • SIZE: the active slice of the SubSlice has zero size.
  • CANCEL: the operation was cancelled by a call to clear_data.
  • FAIL: an internal failure.
Source

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

Called when the data has been added to the digest. data is the SubSliceMut passed in the call to add_mut_data, whose active slice contains the data that was not added. On Ok, data has an active slice of size zero (all data was added). Valid ErrorCode values are:

  • OFF: the underlying digest engine is powered down and cannot be used.
  • BUSY: there is an outstanding add_data, add_data_mut, run, or verify operation, so the digest engine is busy and cannot accept more data.
  • SIZE: the active slice of the SubSlice has zero size.
  • CANCEL: the operation was cancelled by a call to clear_data.
  • FAIL: an internal failure.

Implementors§