# Read in embedded_hal::rng - Rust
Nonblocking stream of random bytes.
Keywords: rust, rustlang, rust-lang, Read

# Trait embedded_hal::rng::Read

source · [−]

    pub trait Read {
        type Error;
        fn try_read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>;
    }

Expand description

Nonblocking stream of random bytes.

## Associated Types

source

#### type Error

An enumeration of RNG errors.

For infallible implementations, will be `Infallible`

## Required methods

source

#### fn try_read(&mut self, buf: &mut [ u8 ]) -> Result<usize, Self::Error>

Get a number of bytes from the RNG.

## Implementors