#[non_exhaustive]pub enum ConstDecodeVarintError {
Overflow,
InsufficientData {
available: usize,
},
Other(&'static str),
}Expand description
Decoding varint error.
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.
Overflow
The buffer does not contain a valid LEB128 encoding.
InsufficientData
The buffer does not contain enough data to decode.
Other(&'static str)
A custom error message.
Implementations§
Source§impl ConstDecodeError
impl ConstDecodeError
Sourcepub const fn overflow() -> ConstDecodeError
pub const fn overflow() -> ConstDecodeError
Creates a new ConstDecodeError::Overflow indicating that the decoded value would overflow the target type.
Sourcepub const fn insufficient_data(available: usize) -> ConstDecodeError
pub const fn insufficient_data(available: usize) -> ConstDecodeError
Creates a new ConstDecodeError::InsufficientData indicating that the buffer does not have enough data
to decode a value.
Sourcepub const fn other(msg: &'static str) -> ConstDecodeError
pub const fn other(msg: &'static str) -> ConstDecodeError
Creates a new ConstDecodeError::Other with the given message.
Trait Implementations§
Source§impl Clone for ConstDecodeError
impl Clone for ConstDecodeError
Source§fn clone(&self) -> ConstDecodeError
fn clone(&self) -> ConstDecodeError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConstDecodeError
impl Debug for ConstDecodeError
Source§impl Display for ConstDecodeError
impl Display for ConstDecodeError
Source§impl Error for ConstDecodeError
impl Error for ConstDecodeError
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()
Source§impl From<ConstDecodeError> for DecodeError
impl From<ConstDecodeError> for DecodeError
Source§fn from(err: ConstDecodeError) -> DecodeError
fn from(err: ConstDecodeError) -> DecodeError
Converts to this type from the input type.
Source§impl Hash for ConstDecodeError
impl Hash for ConstDecodeError
Source§impl PartialEq for ConstDecodeError
impl PartialEq for ConstDecodeError
impl Eq for ConstDecodeError
impl StructuralPartialEq for ConstDecodeError
Auto Trait Implementations§
impl Freeze for ConstDecodeError
impl RefUnwindSafe for ConstDecodeError
impl Send for ConstDecodeError
impl Sync for ConstDecodeError
impl Unpin for ConstDecodeError
impl UnwindSafe for ConstDecodeError
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