Skip to main content

Generator

Trait Generator 

Source
pub trait Generator {
    type Output;

    // Required method
    fn generate(&mut self, output: &mut Self::Output);

    // Provided method
    fn drop(&mut self, output: &mut Self::Output) { ... }
}
Expand description

A random (block) generator

Required Associated Types§

Source

type Output

The output type.

For use with rand_core::block code this must be [u32; _] or [u64; _].

Required Methods§

Source

fn generate(&mut self, output: &mut Self::Output)

Generate a new block of output.

This must fill output with random data.

Provided Methods§

Source

fn drop(&mut self, output: &mut Self::Output)

Destruct the output buffer

This method is called on Drop of the Self::Output buffer. The default implementation does nothing.

Implementors§