# rng.rs - source
Source of the Rust file `/home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-hal-1.0.0-alpha.1/src/rng.rs`.
Keywords: rust, rustlang, rust-lang

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    //! Random Number Generator Interface

    use nb;

    /// Nonblocking stream of random bytes.
    pub trait Read {
        /// An enumeration of RNG errors.
        ///
        /// For infallible implementations, will be `Infallible`
        type Error;

        /// Get a number of bytes from the RNG.
        fn try_read(&mut self, buf: &mut [u8]) -> nb::Result<usize, Self::Error>;
    }