Skip to main content

Block

Trait Block 

Source
pub trait Block: Send + Sync {
    // Required method
    fn apply(&self, s: &mut Frame, rng: &mut Rng) -> Result<()>;

    // Provided methods
    fn needs_training(&self) -> bool { ... }
    fn train(&mut self, _s: &Frame, _rng: &mut Rng) -> Result<()> { ... }
}
Expand description

A block of a link.

Required Methods§

Source

fn apply(&self, s: &mut Frame, rng: &mut Rng) -> Result<()>

Apply the block to the signal of one trial, drawing from rng only.

§Errors

Any error of the underlying algorithm (inconsistent signal, invalid parameter).

Provided Methods§

Source

fn needs_training(&self) -> bool

Whether the block is trained once per condition before the trials.

Source

fn train(&mut self, _s: &Frame, _rng: &mut Rng) -> Result<()>

Train on the signal that reaches the block on an independent training block.

§Errors

Any error of the training.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§