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§
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
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.