pub enum InStreamError {
IoError(Error),
PacketError(PacketError),
ReframingError(ReframingError),
EndOfStream,
UnmatchedOpcode(u16),
}Expand description
Errors encountered when reading packets.
Unlike OutStreamError, there are many more possibilities for an error to occur here, due to accepting mostly untrusted input.
Variants§
IoError(Error)
Something went wrong on the I/O layer.
When the underlying transport layer was disconnected or had other issues while trying to read data, this error occurs.
PacketError(PacketError)
ReframingError(ReframingError)
EndOfStream
The end of the stream was reached, but we expected more data.
UnmatchedOpcode(u16)
When trying to receive a specific packet or protocol, a different or unknown packet was received.
Trait Implementations§
Source§impl Debug for InStreamError
impl Debug for InStreamError
Source§impl Display for InStreamError
impl Display for InStreamError
Source§impl Error for InStreamError
impl Error for InStreamError
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<Error> for InStreamError
impl From<Error> for InStreamError
Source§impl From<InStreamError> for HandshakeError
impl From<InStreamError> for HandshakeError
Source§fn from(source: InStreamError) -> Self
fn from(source: InStreamError) -> Self
Converts to this type from the input type.
Source§impl From<PacketError> for InStreamError
impl From<PacketError> for InStreamError
Source§fn from(source: PacketError) -> Self
fn from(source: PacketError) -> Self
Converts to this type from the input type.
Source§impl From<ReframingError> for InStreamError
impl From<ReframingError> for InStreamError
Source§fn from(source: ReframingError) -> Self
fn from(source: ReframingError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for InStreamError
impl !RefUnwindSafe for InStreamError
impl Send for InStreamError
impl Sync for InStreamError
impl Unpin for InStreamError
impl !UnwindSafe for InStreamError
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