WordFiller

Trait WordFiller 

Source
pub trait WordFiller {
    // Required method
    fn generate(&mut self) -> u16;

    // Provided methods
    fn generate_array<const N: usize>(&mut self) -> [Word; N] { ... }
    fn generate_boxed_array<const N: usize>(&mut self) -> Box<[Word; N]> { ... }
}
Expand description

Trait that describes types that can be used to create the data for an uninitialized Word.

This is used with Word::new_uninit to create uninitialized Words.

Required Methods§

Source

fn generate(&mut self) -> u16

Generate a word of data.

Provided Methods§

Source

fn generate_array<const N: usize>(&mut self) -> [Word; N]

Generates an array of Words.

Source

fn generate_boxed_array<const N: usize>(&mut self) -> Box<[Word; N]>

Generates a heap-allocated array of Words.

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 WordFiller for u16

Source§

fn generate(&mut self) -> u16

Sets each word to the given value.

Source§

impl WordFiller for ()

Source§

fn generate(&mut self) -> u16

This creates unseeded, non-deterministic values.

Source§

impl WordFiller for StdRng

Source§

fn generate(&mut self) -> u16

This creates values from the standard random number generator.

This can be used to create deterministic, seeded values.

Implementors§