Skip to main content

PiWriteParam

Trait PiWriteParam 

Source
pub trait PiWriteParam<E: Endianness>: BitWrite<E> + RiceWrite<E> {
    // Required methods
    fn write_pi_param<const USE_TABLE: bool>(
        &mut self,
        n: u64,
        k: usize,
    ) -> Result<usize, Self::Error>;
    fn write_pi2_param<const USE_TABLE: bool>(
        &mut self,
        n: u64,
    ) -> Result<usize, Self::Error>;
}
Expand description

Parametric trait for writing π codes.

This trait is more general than PiWrite, as it makes it possible to specify how to use tables using const parameters.

We provide an implementation of this trait for BitWrite. An implementation of PiWrite using default values is usually provided exploiting the crate::codes::params::WriteParams mechanism.

Required Methods§

Source

fn write_pi_param<const USE_TABLE: bool>( &mut self, n: u64, k: usize, ) -> Result<usize, Self::Error>

Source

fn write_pi2_param<const USE_TABLE: bool>( &mut self, n: u64, ) -> Result<usize, Self::Error>

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§