Samplable

Trait Samplable 

Source
pub trait Samplable {
    // Required methods
    fn sample_below(upper: &Self) -> Self;
    fn sample_range(lower: &Self, upper: &Self) -> Self;
    fn strict_sample_range(lower: &Self, upper: &Self) -> Self;
    fn sample(bitsize: usize) -> Self;
    fn strict_sample(bit_size: usize) -> Self;
}
Expand description

Sampling trait (e.g., for rejection sampling)

Required Methods§

Source

fn sample_below(upper: &Self) -> Self

Source

fn sample_range(lower: &Self, upper: &Self) -> Self

Source

fn strict_sample_range(lower: &Self, upper: &Self) -> Self

Source

fn sample(bitsize: usize) -> Self

Source

fn strict_sample(bit_size: usize) -> Self

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 Samplable for Mpz

Source§

fn sample_below(upper: &Self) -> Self

Source§

fn sample_range(lower: &Self, upper: &Self) -> Self

Source§

fn strict_sample_range(lower: &Self, upper: &Self) -> Self

Source§

fn sample(bit_size: usize) -> Self

Source§

fn strict_sample(bit_size: usize) -> Self

Implementors§