pub enum AnsError {
InvalidPrecision {
precision_bits: u32,
},
EmptyAlphabet,
InvalidSymbol {
symbol: u32,
alphabet_size: usize,
},
ZeroFrequency {
symbol: u32,
},
InvalidTable(String),
InvalidState {
state: u32,
min_state: u32,
},
TruncatedInput {
available: usize,
needed: usize,
},
}Expand description
Errors for rANS operations.
Variants§
InvalidPrecision
precision_bits was outside the valid range 1..=20.
EmptyAlphabet
The counts slice passed to FrequencyTable::from_counts was empty.
InvalidSymbol
A symbol index exceeded the alphabet size during encoding.
ZeroFrequency
A symbol with zero frequency was encountered during encoding.
InvalidTable(String)
The frequency normalization step could not produce a valid table.
InvalidState
The rANS state read from the byte stream was below RANS_L.
TruncatedInput
The byte stream was shorter than expected during decoding.
Trait Implementations§
Source§impl Error for AnsError
impl Error for AnsError
1.30.0 · 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()
impl Eq for AnsError
impl StructuralPartialEq for AnsError
Auto Trait Implementations§
impl Freeze for AnsError
impl RefUnwindSafe for AnsError
impl Send for AnsError
impl Sync for AnsError
impl Unpin for AnsError
impl UnsafeUnpin for AnsError
impl UnwindSafe for AnsError
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