kernel::hil::entropy

Trait Client32

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

An Entropy32 client

Clients of an Entropy32 must implement this trait.

Required Methods§

Source

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

Called by the (Entropy)[trait.Entropy32.html] when there is 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§