#[non_exhaustive]pub enum FormatError {
BadMagic,
UnsupportedVersion(u8),
UnknownFlags(u8),
NonZeroReserved,
Truncated,
TrailingBytes,
LimitExceeded(&'static str),
InvalidUtf8,
Invalid(&'static str),
}Expand description
Why a byte string is not a valid frame.
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.
BadMagic
The magic bytes differ from the expected frame.
UnsupportedVersion(u8)
The version byte is not supported.
UnknownFlags(u8)
The flags byte has bits that are not defined for the frame.
NonZeroReserved
A reserved field is not zero.
Truncated
The input ends before the frame does.
TrailingBytes
Bytes follow the end of the frame.
LimitExceeded(&'static str)
A count or length exceeds the named limit.
InvalidUtf8
A string is not valid UTF-8.
Invalid(&'static str)
The bytes decode but are not the canonical encoding, or break a rule of the format.
Trait Implementations§
Source§impl Clone for FormatError
impl Clone for FormatError
impl Copy for FormatError
Source§impl Debug for FormatError
impl Debug for FormatError
Source§impl Display for FormatError
impl Display for FormatError
impl Eq for FormatError
Source§impl Error for FormatError
impl Error for FormatError
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 PartialEq for FormatError
impl PartialEq for FormatError
impl StructuralPartialEq for FormatError
Auto Trait Implementations§
impl Freeze for FormatError
impl RefUnwindSafe for FormatError
impl Send for FormatError
impl Sync for FormatError
impl Unpin for FormatError
impl UnsafeUnpin for FormatError
impl UnwindSafe for FormatError
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