Skip to main content

Random

Trait Random 

Source
pub trait Random {
    type Output;

    // Required method
    fn random(&mut self) -> Self::Output;
}
Expand description

A trait for random generators.

Required Associated Types§

Source

type Output

The output type of the random generator.

Required Methods§

Source

fn random(&mut self) -> Self::Output

Returns a random instance of the output type.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§