Random

Trait Random 

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

    // Provided method
    fn random_n<Container: FromIterator<Self>>(
        rng: impl CryptoRngCore,
        size: usize,
    ) -> Container { ... }
}
Expand description

A trait for getting a random value for a type. Will be replaced by the random feature once it is included in std (https://github.com/rust-lang/rust/issues/130703).

Required Methods§

Source

fn random(rng: impl CryptoRngCore) -> Self

Provided Methods§

Source

fn random_n<Container: FromIterator<Self>>( rng: impl CryptoRngCore, size: usize, ) -> Container

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§

Source§

impl<C: Curve> Random for CurveKey<C>

Source§

impl<C: Curve> Random for PointShare<C>

Source§

impl<C: Curve, M: Positive> Random for CurveKeys<C, M>

Source§

impl<C: Curve, M: Positive> Random for PointShares<C, M>

Source§

impl<F: FieldExtension> Random for SubfieldElement<F>

Source§

impl<F: FieldExtension> Random for FieldShareKey<F>

Source§

impl<F: FieldExtension> Random for FieldShare<F>

Source§

impl<F: FieldExtension, M: Positive> Random for FieldShareKeys<F, M>

Source§

impl<F: FieldExtension, M: Positive> Random for FieldShares<F, M>

Source§

impl<T> Random for T

Generalise so that rand::random() can be used for any type that implements Random.

Source§

impl<T: Sized + Random, M: Positive> Random for HeapArray<T, M>