#[non_exhaustive]pub enum InvalidDataError {
NotEnoughBytes,
IntegerOverflow,
InvalidUtf8,
}
Expand description
Indicates that an error has occured because the bytes being decoded were invalid in some way. Note: In versions 0.2.0 and before this was called DataDecodeError.
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.
NotEnoughBytes
The underlying reader did not return enough data to construct the type being read.
IntegerOverflow
The underlying data overflowed the current integer type being constructed.
InvalidUtf8
The underlaying data could not be converted to the type because it is not valid utf-8
Trait Implementations§
Source§impl Clone for InvalidDataError
impl Clone for InvalidDataError
Source§fn clone(&self) -> InvalidDataError
fn clone(&self) -> InvalidDataError
Returns a copy 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 InvalidDataError
impl Debug for InvalidDataError
Source§impl Display for InvalidDataError
impl Display for InvalidDataError
Source§impl Error for InvalidDataError
impl Error for InvalidDataError
Source§fn source(&self) -> Option<&(dyn stdError + 'static)>
fn source(&self) -> Option<&(dyn stdError + 'static)>
Returns the lower-level source of this error, if any. Read more
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<InvalidDataError> for DataDecodeError
impl From<InvalidDataError> for DataDecodeError
Source§fn from(source: InvalidDataError) -> Self
fn from(source: InvalidDataError) -> Self
Converts to this type from the input type.
Source§impl Hash for InvalidDataError
impl Hash for InvalidDataError
Source§impl PartialEq for InvalidDataError
impl PartialEq for InvalidDataError
impl Copy for InvalidDataError
impl Eq for InvalidDataError
impl StructuralPartialEq for InvalidDataError
Auto Trait Implementations§
impl Freeze for InvalidDataError
impl RefUnwindSafe for InvalidDataError
impl Send for InvalidDataError
impl Sync for InvalidDataError
impl Unpin for InvalidDataError
impl UnwindSafe for InvalidDataError
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