Random

Trait Random 

Source
pub trait Random {
    // Required method
    fn random(rng: impl CryptoRngCore) -> Self;
}
Expand description

A trait for objects that can be randomly sampled.

The only stipulation about this sampling process is that the result should be indistinguishable from one sampled uniformly at random.

Beyond that, we don’t assume that we don’t learn other things about the object as the sampler.

Required Methods§

Source

fn random(rng: impl CryptoRngCore) -> Self

Sample an object uniformly at random.

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§