pub enum DecodeError {
Truncated {
needed: usize,
remaining: usize,
},
TrailingBytes(usize),
InvalidBool(u8),
InvalidOptionTag(u8),
OverLimit {
len: usize,
max: usize,
},
InvalidUtf8,
UnknownFormat(u8),
UnknownSuite(u8),
Invalid(&'static str),
}Expand description
The input is not a canonical encoding (specification §3.1).
Variants§
Truncated
A fixed field, length or count needs more bytes than remain.
TrailingBytes(usize)
Bytes after the top-level object.
InvalidBool(u8)
A bool byte other than 0x00 or 0x01.
InvalidOptionTag(u8)
An option tag other than 0x00 or 0x01.
OverLimit
A length or count above the field’s limit.
InvalidUtf8
A string that is not valid UTF-8.
UnknownFormat(u8)
An unknown format byte.
UnknownSuite(u8)
An unknown suite byte (0x00, 0x02–0xFF).
Invalid(&'static str)
A field breaks a rule of its object (the field name).
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DecodeError
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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<DecodeError> for VoiceError
impl From<DecodeError> for VoiceError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<DecodeError> for PackageError
impl From<DecodeError> for PackageError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<DecodeError> for SignedError
impl From<DecodeError> for SignedError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<DecodeError> for LinkError
impl From<DecodeError> for LinkError
Source§fn from(_: DecodeError) -> Self
fn from(_: DecodeError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
impl StructuralPartialEq for DecodeError
Auto Trait Implementations§
impl Freeze for DecodeError
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnsafeUnpin for DecodeError
impl UnwindSafe for DecodeError
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