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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl BitStore for u32

Source§

const BITS: u32 = 32u32

Source§

const ONE: Self = 1u32

Source§

const ZERO: Self = 0u32

Source§

fn log2(self) -> u32

Source§

impl BitStore for u64

Source§

const BITS: u32 = 64u32

Source§

const ONE: Self = 1u64

Source§

const ZERO: Self = 0u64

Source§

fn log2(self) -> u32

Source§

impl BitStore for u128

Source§

const BITS: u32 = 128u32

Source§

const ONE: Self = 1u128

Source§

const ZERO: Self = 0u128

Source§

fn log2(self) -> u32

Source§

impl BitStore for usize

Source§

const BITS: u32 = 32u32

Source§

const ONE: Self = 1usize

Source§

const ZERO: Self = 0usize

Source§

fn log2(self) -> u32

Implementors§