Trait RandConstructEnum

Source
pub trait RandConstructEnum:
    Sized
    + Clone
    + Default
    + Eq
    + Hash {
    // Required methods
    fn default_weight(&self) -> f64;
    fn all_variants() -> Vec<Self>;
    fn create_default_probability_map() -> Arc<HashMap<Self, f64>>;

    // Provided methods
    fn random_variant() -> Self { ... }
    fn uniform_variant() -> Self { ... }
    fn random_enum_value_with_rng<RNG>(rng: &mut RNG) -> Self
       where RNG: Rng + ?Sized { ... }
}

Required Methods§

Provided Methods§

Source

fn random_variant() -> Self

Source

fn uniform_variant() -> Self

Source

fn random_enum_value_with_rng<RNG>(rng: &mut RNG) -> Self
where RNG: Rng + ?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.

Implementors§