Skip to main content

BitStore

Trait BitStore 

Source
pub trait BitStore:
    Shl<u32, Output = Self>
    + ShlAssign<u32>
    + Sub<Output = Self>
    + Add<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + AddAssign
    + PartialOrd
    + Copy
    + Debug {
    const BITS: u32;
    const ZERO: Self;
    const ONE: Self;

    // Required method
    fn log2(self) -> u32;
}
Expand description

A trait for a type that can be used for the internal integer representation of an encoder or decoder

Required Associated Constants§

Source

const BITS: u32

the number of bits needed to represent this type

Source

const ZERO: Self

the additive identity

Source

const ONE: Self

the multiplicative identity

Required Methods§

Source

fn log2(self) -> u32

integer natural logarithm, rounded down

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl BitStore for u32

Source§

const BITS: u32 = Self::BITS

Source§

const ONE: u32 = 1

Source§

const ZERO: u32 = 0

Source§

fn log2(self) -> u32

Source§

impl BitStore for u64

Source§

const BITS: u32 = Self::BITS

Source§

const ONE: u64 = 1

Source§

const ZERO: u64 = 0

Source§

fn log2(self) -> u32

Source§

impl BitStore for u128

Source§

const BITS: u32 = Self::BITS

Source§

const ONE: u128 = 1

Source§

const ZERO: u128 = 0

Source§

fn log2(self) -> u32

Source§

impl BitStore for usize

Source§

const BITS: u32 = Self::BITS

Source§

const ONE: usize = 1

Source§

const ZERO: usize = 0

Source§

fn log2(self) -> u32

Implementors§