kernel::hil::entropy

Trait Client8

Source
pub trait Client8 {
    // Required method
    fn entropy_available(
        &self,
        entropy: &mut dyn Iterator<Item = u8>,
        error: Result<(), ErrorCode>,
    ) -> Continue;
}
Expand description

An Entropy8 client

Clients of an Entropy8 must implement this trait.

Required Methods§

Source

fn entropy_available( &self, entropy: &mut dyn Iterator<Item = u8>, error: Result<(), ErrorCode>, ) -> Continue

Called by the (Entropy)[trait.Entropy8.html] when there are one or more bytes of entropy available.

entropy in an Iterator of available entropy. The amount of entropy available may increase if entropy is not consumed quickly so clients should not rely on iterator termination to finish consuming entropy.

The client returns either Continue::More if the iterator did not have enough entropy (indicating another entropy_available callback is requested) and the client would like to be called again when more is available, or Continue::Done, which indicates entropy_available should not be called again until get() is called.

If entropy_available is triggered after a call to cancel() then error MUST be CANCEL and entropy MAY contain bits of entropy.

Implementors§