#[non_exhaustive]pub enum FrameHeaderError {
TooShort(usize),
BadMagic {
got: u16,
},
UnsupportedVersion(u8),
}Expand description
Errors returned by FrameHeader::decode.
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.
TooShort(usize)
Buffer is shorter than HEADER_SIZE bytes.
BadMagic
First two bytes do not match FRAME_MAGIC.
UnsupportedVersion(u8)
Version byte is not SUPPORTED_VERSION.
Trait Implementations§
Source§impl Debug for FrameHeaderError
impl Debug for FrameHeaderError
Source§impl Display for FrameHeaderError
impl Display for FrameHeaderError
Source§impl Error for FrameHeaderError
impl Error for FrameHeaderError
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 FrameHeaderError
impl PartialEq for FrameHeaderError
Source§fn eq(&self, other: &FrameHeaderError) -> bool
fn eq(&self, other: &FrameHeaderError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for FrameHeaderError
impl StructuralPartialEq for FrameHeaderError
Auto Trait Implementations§
impl Freeze for FrameHeaderError
impl RefUnwindSafe for FrameHeaderError
impl Send for FrameHeaderError
impl Sync for FrameHeaderError
impl Unpin for FrameHeaderError
impl UnsafeUnpin for FrameHeaderError
impl UnwindSafe for FrameHeaderError
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