pub enum BitError {
UnexpectedEof {
requested: usize,
available: usize,
},
WriteOverflow {
attempted: usize,
available: usize,
},
InvalidBitCount {
bits: u8,
max_bits: u8,
},
ValueOutOfRange {
value: u64,
bits: u8,
},
InvalidVarint,
MisalignedAccess {
bit_position: usize,
},
}Expand description
Errors that can occur during bit-level encoding/decoding.
Variants§
UnexpectedEof
Attempted to read past the end of the buffer.
WriteOverflow
Attempted to write more bits than the buffer can hold.
Fields
InvalidBitCount
Invalid bit count for the operation.
Fields
ValueOutOfRange
Value exceeds the range representable by the specified number of bits.
InvalidVarint
Invalid varint encoding (too many bytes or overflow).
MisalignedAccess
Attempted to read or write a byte-aligned value when not aligned.
Trait Implementations§
Source§impl Error for BitError
impl Error for BitError
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 BitError
impl StructuralPartialEq for BitError
Auto Trait Implementations§
impl Freeze for BitError
impl RefUnwindSafe for BitError
impl Send for BitError
impl Sync for BitError
impl Unpin for BitError
impl UnwindSafe for BitError
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