#[non_exhaustive]pub enum PrimitiveErrorKind {
InsufficientData {
needed: usize,
available: usize,
},
InvalidVarint {
max_bytes: u8,
},
LengthOutOfRange {
length: u32,
},
}Expand description
Specific reason a primitive read failed.
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.
InsufficientData
Buffer ran out before the requested width was satisfied.
InvalidVarint
Varint exceeded the maximum allowed byte length (5 for u32, 10 for u64).
LengthOutOfRange
A compact length prefix decoded to a value that overflows i32.
Trait Implementations§
Source§impl Debug for PrimitiveErrorKind
impl Debug for PrimitiveErrorKind
Source§impl Display for PrimitiveErrorKind
impl Display for PrimitiveErrorKind
Source§impl Error for PrimitiveErrorKind
impl Error for PrimitiveErrorKind
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<PrimitiveErrorKind> for PrimitiveError
impl From<PrimitiveErrorKind> for PrimitiveError
Source§fn from(kind: PrimitiveErrorKind) -> Self
fn from(kind: PrimitiveErrorKind) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PrimitiveErrorKind
impl RefUnwindSafe for PrimitiveErrorKind
impl Send for PrimitiveErrorKind
impl Sync for PrimitiveErrorKind
impl Unpin for PrimitiveErrorKind
impl UnsafeUnpin for PrimitiveErrorKind
impl UnwindSafe for PrimitiveErrorKind
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