rand

Trait Fill

Source
pub trait Fill {
    // Required method
    fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>;
}
Expand description

Types which may be filled with random data

This trait allows arrays to be efficiently filled with random data.

Implementations are expected to be portable across machines unless clearly documented otherwise (see the Chapter on Portability).

Required Methods§

Source

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Fill self with random data

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Fill for [bool]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [char]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [f32]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [f64]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [i8]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [i16]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [i32]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [i64]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [i128]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [isize]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [u8]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [u16]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [u32]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [u64]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [u128]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [usize]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<i8>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<i16>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<i32>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<i64>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<i128>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<isize>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<u16>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<u32>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<u64>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<u128>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl Fill for [Wrapping<usize>]

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Source§

impl<T, const N: usize> Fill for [T; N]
where [T]: Fill,

Source§

fn try_fill<R: Rng + ?Sized>(&mut self, rng: &mut R) -> Result<(), Error>

Implementors§