pub trait ClientData<const L: usize> {
    fn add_data_done(
        &self,
        result: Result<(), ErrorCode>,
        data: LeasableBuffer<'static, u8>
    ); fn add_mut_data_done(
        &self,
        result: Result<(), ErrorCode>,
        data: LeasableMutableBuffer<'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

Called when the data has been added to the digest. data is the LeasableBuffer 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 LeasableBuffer has zero size.
  • CANCEL: the operation was cancelled by a call to clear_data.
  • FAIL: an internal failure.

Called when the data has been added to the digest. data is the LeasableMutableBuffer 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 LeasableBuffer has zero size.
  • CANCEL: the operation was cancelled by a call to clear_data.
  • FAIL: an internal failure.

Implementors