pub struct CodesStats {
pub unary: u64,
pub gamma: u64,
pub delta: u64,
pub zeta: [u64; 10],
pub golomb: [u64; 20],
}Expand description
Keeps track of the space needed to store a stream of integers using different codes.
This structure can be used to determine empirically which code provides the
best compression for a given stream. You have to update the
structure with the integers in the stream; at any time, you
can examine the statistics or call best_code to get the
best code.
Fields§
§unary: u64§gamma: u64§delta: u64§zeta: [u64; 10]§golomb: [u64; 20]Implementations§
Trait Implementations§
Source§impl CopyType for CodesStats
impl CopyType for CodesStats
Source§impl Debug for CodesStats
impl Debug for CodesStats
Source§impl Default for CodesStats
impl Default for CodesStats
Source§fn default() -> CodesStats
fn default() -> CodesStats
Returns the “default value” for a type. Read more
Source§impl MemDbgImpl for CodesStats
impl MemDbgImpl for CodesStats
Auto Trait Implementations§
impl Freeze for CodesStats
impl RefUnwindSafe for CodesStats
impl Send for CodesStats
impl Sync for CodesStats
impl Unpin for CodesStats
impl UnwindSafe for CodesStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Truncate the current UnsignedInt to a possibly smaller size
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
Source§impl<T> MemDbg for Twhere
T: MemDbgImpl,
impl<T> MemDbg for Twhere
T: MemDbgImpl,
Source§fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>
fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>
Write to stdout debug infos about the structure memory usage, expanding
all levels of nested structures.
Source§fn mem_dbg_on(
&self,
writer: &mut impl Write,
flags: DbgFlags,
) -> Result<(), Error>
fn mem_dbg_on( &self, writer: &mut impl Write, flags: DbgFlags, ) -> Result<(), Error>
Write to a
core::fmt::Write debug infos about the structure memory usage,
expanding all levels of nested structures.Source§fn mem_dbg_depth(
&self,
total_size: usize,
max_depth: usize,
flags: DbgFlags,
) -> Result<(), Error>
fn mem_dbg_depth( &self, total_size: usize, max_depth: usize, flags: DbgFlags, ) -> Result<(), Error>
Write to stdout debug infos about the structure memory usage, but expanding only
up to
max_depth levels of nested structures.Source§fn mem_dbg_depth_on(
&self,
writer: &mut impl Write,
total_size: usize,
max_depth: usize,
prefix: &mut String,
field_name: Option<&str>,
is_last: bool,
flags: DbgFlags,
) -> Result<(), Error>
fn mem_dbg_depth_on( &self, writer: &mut impl Write, total_size: usize, max_depth: usize, prefix: &mut String, field_name: Option<&str>, is_last: bool, flags: DbgFlags, ) -> Result<(), Error>
Write to a
core::fmt::Write debug infos about the structure memory usage,
but expanding only up to max_depth levels of nested structures.Source§impl<T> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
Source§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.