Trait RandomInstance

Source
pub trait RandomInstance {
    // Required method
    fn random() -> Self;

    // Provided methods
    fn opt_random() -> Option<Self>
       where Self: Sized { ... }
    fn random_with_size(_size: usize) -> Self
       where Self: Sized { ... }
    fn opt_random_with_size(size: usize) -> Option<Self>
       where Self: Sized { ... }
}

Required Methods§

Source

fn random() -> Self

Provided Methods§

Source

fn opt_random() -> Option<Self>
where Self: Sized,

Source

fn random_with_size(_size: usize) -> Self
where Self: Sized,

Source

fn opt_random_with_size(size: usize) -> Option<Self>
where Self: Sized,

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 RandomInstance for u8

Source§

fn random() -> Self

Source§

impl RandomInstance for u32

Source§

fn random() -> Self

Source§

impl RandomInstance for usize

Source§

fn random() -> Self

Source§

impl RandomInstance for String

Source§

fn random() -> Self

Source§

impl RandomInstance for Attachments

Source§

fn random() -> Self

Source§

impl<K, V> RandomInstance for HashMap<K, V>

Source§

fn random() -> Self

Source§

impl<T> RandomInstance for Vec<T>
where T: RandomInstance,

Source§

fn random() -> Self

Source§

impl<T> RandomInstance for HashSet<T>
where T: RandomInstance + Hash + Eq + Clone,

Source§

fn random() -> Self

Implementors§