[][src]Trait kernel::hil::entropy::Client8

pub trait Client8 {
    fn entropy_available(
        &self,
        entropy: &mut dyn Iterator<Item = u8>,
        error: ReturnCode
    ) -> Continue; }

An Entropy8 client

Clients of an Entropy8 must implement this trait.

Required methods

fn entropy_available(
    &self,
    entropy: &mut dyn Iterator<Item = u8>,
    error: ReturnCode
) -> 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 ECANCEL and entropy MAY contain bits of entropy.

Loading content...

Implementors

Loading content...