Skip to main content

Generatable

Trait Generatable 

Source
pub trait Generatable: Sized {
    // Required method
    fn random(rng: &mut SafeRand) -> Result<Self, RandomError>;
}
Expand description

A trait for types that can be generated randomly. The random number generator is passed as an argument to the generate method and must implement the SafeRand trait.

Required Methods§

Source

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Generatable for NonZeroU16

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl Generatable for i8

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl Generatable for i16

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl Generatable for i32

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl Generatable for i64

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl Generatable for i128

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl Generatable for u8

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl Generatable for u16

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl Generatable for u32

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl Generatable for u64

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl Generatable for u128

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl<T, G> Generatable for Equatable<T>
where G: Generatable, Self: Controlled<Inner = G>,

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl<T, G> Generatable for Exportable<T>
where G: Generatable, Self: Controlled<Inner = G>,

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl<T, G> Generatable for Protected<T>
where G: Generatable, Self: Controlled<Inner = G>,

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl<T, S, G> Generatable for Usage<T, S>
where G: Generatable, Self: Controlled<Inner = G>,

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Source§

impl<const N: usize> Generatable for [u8; N]

Source§

fn random(rng: &mut SafeRand) -> Result<Self, RandomError>

Implementors§