RansDecSymbol

Trait RansDecSymbol 

Source
pub trait RansDecSymbol {
    // Required methods
    fn new(cum_freq: u32, freq: u32) -> Self;
    fn cum_freq(&self) -> u32;
    fn freq(&self) -> u32;
}
Expand description

A symbol that can be decoded using a rANS decoder.

Required Methods§

Source

fn new(cum_freq: u32, freq: u32) -> Self

Creates a new rANS decoder symbol instance.

§Examples
use rans::byte_decoder::ByteRansDecSymbol;
use rans::RansDecSymbol;

let _symbol = ByteRansDecSymbol::new(0, 2);
Source

fn cum_freq(&self) -> u32

Returns this symbol’s cumulative frequency.

§Examples
use rans::byte_decoder::ByteRansDecSymbol;
use rans::RansDecSymbol;

let symbol = ByteRansDecSymbol::new(0, 2);
assert_eq!(symbol.cum_freq(), 0);
Source

fn freq(&self) -> u32

Returns this symbol’s frequency.

§Examples
use rans::byte_decoder::ByteRansDecSymbol;
use rans::RansDecSymbol;

let symbol = ByteRansDecSymbol::new(0, 2);
assert_eq!(symbol.freq(), 2);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§