Skip to main content

Sink

Trait Sink 

Source
pub trait Sink {
    // Required methods
    fn bit(&mut self, lane: usize, bit: bool, p1: u32) -> bool;
    fn raw(&mut self, lane: usize, v: u32, n: u32) -> u32;

    // Provided method
    fn note(&mut self, _idx: usize, _bit: bool) { ... }
}
Expand description

A symbol sink/source for one brick: binary decisions at a probability, and raw bit chunks, per lane.

Required Methods§

Source

fn bit(&mut self, lane: usize, bit: bool, p1: u32) -> bool

Code bit with P(1) = p1/2^16 on lane; returns the bit.

Source

fn raw(&mut self, lane: usize, v: u32, n: u32) -> u32

Code the low n ≤ 16 bits of v raw.

Provided Methods§

Source

fn note(&mut self, _idx: usize, _bit: bool)

Observe a modelled decision on model idx (prior counting).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§