Skip to main content

CanSample

Trait CanSample 

Source
pub trait CanSample<T> {
    // Required method
    fn sample(&mut self) -> T;

    // Provided methods
    fn sample_array<const N: usize>(&mut self) -> [T; N] { ... }
    fn sample_vec(&mut self, n: usize) -> Vec<T> { ... }
}

Required Methods§

Source

fn sample(&mut self) -> T

Provided Methods§

Source

fn sample_array<const N: usize>(&mut self) -> [T; N]

Source

fn sample_vec(&mut self, n: usize) -> Vec<T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T, U: 'a + CanSample<T> + ?Sized> CanSample<T> for &'a mut U

Source§

fn sample(&mut self) -> T

Source§

fn sample_array<const N: usize>(&mut self) -> [T; N]

Source§

fn sample_vec(&mut self, n: usize) -> Vec<T>

Implementors§

Source§

impl<F, Challenger_> CanSample<F> for ProverTranscript<Challenger_>
where F: Field, Challenger_: Challenger,

Source§

impl<F, Challenger_> CanSample<F> for VerifierTranscript<Challenger_>
where F: Field, Challenger_: Challenger,