Skip to main content

Bits

Trait Bits 

Source
pub trait Bits {
    // Required methods
    fn bit(&mut self, bit: bool, m: &mut BitModel) -> bool;
    fn bitp(&mut self, bit: bool, p1: u32) -> bool;
    fn uint(&mut self, v: u64, m: &mut UintModel) -> u64;

    // Provided method
    fn tag(&mut self, _t: usize) { ... }
}
Expand description

Symmetric encode/decode of single decisions.

Required Methods§

Source

fn bit(&mut self, bit: bool, m: &mut BitModel) -> bool

Code bit (ignored when decoding) with an adaptive model.

Source

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

Code bit with a fixed probability P(1) = p1/2^16.

Source

fn uint(&mut self, v: u64, m: &mut UintModel) -> u64

Code an unbounded non-negative integer.

Provided Methods§

Source

fn tag(&mut self, _t: usize)

Accounting tag for the decisions that follow (no-op for real coders).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§