#[non_exhaustive]pub enum Codes {
Unary,
Gamma,
Delta,
Omega,
VByteLe,
VByteBe,
Zeta {
k: usize,
},
Pi {
k: usize,
},
Golomb {
b: usize,
},
ExpGolomb {
k: usize,
},
Rice {
log2_b: usize,
},
}
Expand description
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl Codes
impl Codes
Sourcepub fn read<E: Endianness, CR: CodesRead<E> + ?Sized>(
&self,
reader: &mut CR,
) -> Result<u64, CR::Error>
pub fn read<E: Endianness, CR: CodesRead<E> + ?Sized>( &self, reader: &mut CR, ) -> Result<u64, CR::Error>
Delegate to the DynamicCodeRead
implementation.
This inherent method is provided to reduce ambiguity in method resolution.
Sourcepub fn write<E: Endianness, CW: CodesWrite<E> + ?Sized>(
&self,
writer: &mut CW,
value: u64,
) -> Result<usize, CW::Error>
pub fn write<E: Endianness, CW: CodesWrite<E> + ?Sized>( &self, writer: &mut CW, value: u64, ) -> Result<usize, CW::Error>
Delegate to the DynamicCodeWrite
implementation.
This inherent method is provided to reduce ambiguity in method resolution.
Sourcepub fn to_code_const(&self) -> Result<usize>
pub fn to_code_const(&self) -> Result<usize>
Convert a code to the constant enum code_consts
used for ConstCode
.
This is mostly used to verify that the code is supported by
ConstCode
.
Sourcepub fn from_code_const(const_code: usize) -> Result<Self>
pub fn from_code_const(const_code: usize) -> Result<Self>
Convert a value from code_consts
to a code.
Trait Implementations§
Source§impl DynamicCodeRead for Codes
impl DynamicCodeRead for Codes
Source§impl DynamicCodeWrite for Codes
impl DynamicCodeWrite for Codes
Source§impl MemDbgImpl for Codeswhere
usize: MemDbgImpl,
impl MemDbgImpl for Codeswhere
usize: MemDbgImpl,
fn _mem_dbg_rec_on( &self, _memdbg_writer: &mut impl Write, _memdbg_total_size: usize, _memdbg_max_depth: usize, _memdbg_prefix: &mut String, _memdbg_is_last: bool, _memdbg_flags: DbgFlags, ) -> Result
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, padded_size: usize, flags: DbgFlags, ) -> Result<(), Error>
Source§impl PartialEq for Codes
Some codes are equivalent, so we implement PartialEq
to make them
interchangeable so Codes::Unary == Codes::Rice{log2_b: 0}
.
impl PartialEq for Codes
Some codes are equivalent, so we implement PartialEq
to make them
interchangeable so Codes::Unary == Codes::Rice{log2_b: 0}
.
Source§impl<E: Endianness, CR: CodesRead<E> + ?Sized> StaticCodeRead<E, CR> for Codes
impl<E: Endianness, CR: CodesRead<E> + ?Sized> StaticCodeRead<E, CR> for Codes
Source§impl<E: Endianness, CW: CodesWrite<E> + ?Sized> StaticCodeWrite<E, CW> for Codes
impl<E: Endianness, CW: CodesWrite<E> + ?Sized> StaticCodeWrite<E, CW> for Codes
impl Copy for Codes
impl Eq for Codes
Auto Trait Implementations§
impl Freeze for Codes
impl RefUnwindSafe for Codes
impl Send for Codes
impl Sync for Codes
impl Unpin for Codes
impl UnwindSafe for Codes
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Writes to stderr 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>
Writes to a
core::fmt::Write
debug infos about the structure memory
usage, expanding all levels of nested structures.Source§fn mem_dbg_depth(&self, max_depth: usize, flags: DbgFlags) -> Result<(), Error>
fn mem_dbg_depth(&self, max_depth: usize, flags: DbgFlags) -> Result<(), Error>
Writes to stderr debug infos about the structure memory usage as
mem_dbg
, but expanding only up to max_depth
levels of nested structures.Source§fn mem_dbg_depth_on(
&self,
writer: &mut impl Write,
max_depth: usize,
flags: DbgFlags,
) -> Result<(), Error>
fn mem_dbg_depth_on( &self, writer: &mut impl Write, max_depth: usize, flags: DbgFlags, ) -> Result<(), Error>
Writes to a
core::fmt::Write
debug infos about the structure memory
usage as mem_dbg_on
, 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.