pub enum PreambleError {
Incomplete,
BadMagic(u8),
UnknownKind(u8),
HeaderTooLarge {
len: u64,
max: u64,
},
}Expand description
Why a preamble was rejected.
Variants§
Incomplete
Not enough bytes yet. Read more and retry; not a protocol violation.
BadMagic(u8)
The first byte was not MAGIC.
UnknownKind(u8)
The kind byte is not defined in this protocol version.
HeaderTooLarge
The advertised header length exceeds the local cap. Reported before any allocation is attempted.
Implementations§
Source§impl PreambleError
impl PreambleError
Sourcepub const fn is_violation(self) -> bool
pub const fn is_violation(self) -> bool
True if the error is fatal for the connection. Only
PreambleError::Incomplete is not.
Trait Implementations§
Source§impl Clone for PreambleError
impl Clone for PreambleError
impl Copy for PreambleError
Source§impl Debug for PreambleError
impl Debug for PreambleError
Source§impl Display for PreambleError
impl Display for PreambleError
impl Eq for PreambleError
Source§impl Error for PreambleError
impl Error for PreambleError
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 PreambleError
impl PartialEq for PreambleError
impl StructuralPartialEq for PreambleError
Auto Trait Implementations§
impl Freeze for PreambleError
impl RefUnwindSafe for PreambleError
impl Send for PreambleError
impl Sync for PreambleError
impl Unpin for PreambleError
impl UnsafeUnpin for PreambleError
impl UnwindSafe for PreambleError
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