pub enum ArithError {
InvalidStateBits(u32),
InvalidBit(u8),
EmptyFreqTable,
InvalidSymbol {
symbol: usize,
len: usize,
},
ZeroFrequencySymbol(usize),
TotalTooLarge {
total: u64,
max: u64,
},
StateWidthMismatch {
expected: u32,
found: u32,
},
InvalidStreamState(String),
UnexpectedEof,
Io(Error),
}Expand description
Errors returned by arithmetic coding and bit stream operations.
Variants§
InvalidStateBits(u32)
State bit width is outside the supported [1, 62] range.
InvalidBit(u8)
Attempted to write a bit value other than 0 or 1.
EmptyFreqTable
Frequency table is empty.
InvalidSymbol
Symbol index is out of bounds for the frequency table.
ZeroFrequencySymbol(usize)
Symbol has zero probability mass in the cumulative frequency table.
TotalTooLarge
Total frequency count exceeds the coder’s maximum allowed total.
Fields
StateWidthMismatch
Restored checkpoint state does not match the coder’s configured bit width.
InvalidStreamState(String)
Restored bit stream state contains invalid bit counts.
UnexpectedEof
Unexpected end of input bit stream when a non-EOF bit was requested.
Io(Error)
Underlying I/O error.
Trait Implementations§
Source§impl Debug for ArithError
impl Debug for ArithError
Source§impl Display for ArithError
impl Display for ArithError
Source§impl Error for ArithError
impl Error for ArithError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for ArithError
impl !UnwindSafe for ArithError
impl Freeze for ArithError
impl Send for ArithError
impl Sync for ArithError
impl Unpin for ArithError
impl UnsafeUnpin for ArithError
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