pub enum FrameError {
LengthTruncated,
LengthTooLarge(u32),
BodyTruncated {
expected: u32,
actual: usize,
},
DecodeFailed,
Io(Error),
}Expand description
Errors emitted by the framing layer. Wire-protocol errors (a frame
longer than MAX_FRAME_BYTES, a truncated read) are distinct
from decode errors so callers can decide whether to close the
connection or just surface a parse failure.
Variants§
LengthTruncated
The 4-byte length prefix could not be read in full.
LengthTooLarge(u32)
The advertised length exceeded MAX_FRAME_BYTES. Receivers
MUST close the connection rather than continue reading.
BodyTruncated
The frame body could not be read in full (peer closed, IO error, etc.).
DecodeFailed
The frame body did not decode as the expected message type.
Io(Error)
Underlying IO error.
Trait Implementations§
Source§impl Debug for FrameError
impl Debug for FrameError
Source§impl Display for FrameError
impl Display for FrameError
Source§impl Error for FrameError
impl Error for FrameError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for FrameError
impl !UnwindSafe for FrameError
impl Freeze for FrameError
impl Send for FrameError
impl Sync for FrameError
impl Unpin for FrameError
impl UnsafeUnpin for FrameError
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