[][src]Trait kernel::hil::rng::Client

pub trait Client {
    fn randomness_available(
        &self,
        randomness: &mut dyn Iterator<Item = u32>,
        error: ReturnCode
    ) -> Continue; }

An Rng client

Clients of an Rng must implement this trait.

Required methods

fn randomness_available(
    &self,
    randomness: &mut dyn Iterator<Item = u32>,
    error: ReturnCode
) -> Continue

Called by the (RNG)[trait.RNG.html] when there are one or more random numbers available

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

The client returns either Continue::More if the iterator did not have enough random values and the client would like to be called again when more is available, or Continue::Done.

If randoness_available is triggered after a call to cancel() then error MUST be ECANCEL and randomness MAY contain random bits.

Loading content...

Implementors

Loading content...