Enum bytes_varint::VarIntError
source · pub enum VarIntError {
NumericOverflow,
BufferUnderflow,
}Expand description
Variable-length decoding can fail, and callers have no way of performing checks up-front to ensure success. This is different from fixed-length decoding that is guaranteed to succeed if e.g. the buffer has at least four available bytes when decoding an i32.
Variants§
NumericOverflow
Returned if the encoded number has more bits than the primitive integer type into which it is decoded.
Implementations do not attempt to consume remaining bytes beyond the target type’s capacity, and a numeric overflow leaves the buffer’s pointer in an undefined position.
BufferUnderflow
Returned if the encoded number specifies that there are more bytes to come, but the buffer has no more available bytes
Trait Implementations§
source§impl Debug for VarIntError
impl Debug for VarIntError
source§impl PartialEq<VarIntError> for VarIntError
impl PartialEq<VarIntError> for VarIntError
source§fn eq(&self, other: &VarIntError) -> bool
fn eq(&self, other: &VarIntError) -> bool
This method tests for
self and other values to be equal, and is used
by ==.