Skip to main content

Sampler

Trait Sampler 

Source
pub trait Sampler: Send {
    // Required method
    fn apply(
        &mut self,
        candidates: &mut Candidates,
        ctx: &mut SamplerCtx<'_>,
    ) -> Result<(), Error>;

    // Provided method
    fn reset(&mut self) { ... }
}
Expand description

One object-safe stage in a sampling chain.

Required Methods§

Source

fn apply( &mut self, candidates: &mut Candidates, ctx: &mut SamplerCtx<'_>, ) -> Result<(), Error>

Applies the stage to the current candidates.

Provided Methods§

Source

fn reset(&mut self)

Restores per-sequence state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§