Enum ProtocolError
pub enum ProtocolError {
Show 19 variants
Utf8(OpaqueError),
Io(Error),
InvalidOpcode(u8),
InvalidCloseSequence,
MessageTooLong {
size: usize,
max_size: usize,
},
UnmaskedFrameFromClient,
WriteBufferFull(Message),
SendAfterClosing,
ReceivedAfterClosing,
NonZeroReservedBits,
MaskedFrameFromServer,
FragmentedControlFrame,
ControlFrameTooBig,
UnknownControlFrameType(u8),
ResetWithoutClosingHandshake,
UnexpectedContinueFrame,
ExpectedFragment(OpCodeData),
UnknownDataFrameType(u8),
DeflateError(OpaqueError),
}
Expand description
Indicates the specific type/cause of a protocol error.
Variants§
Utf8(OpaqueError)
a utf-8 decode error
Io(Error)
Input-output error.
These are generally errors with the underlying connection and you should probably consider them fatal.
InvalidOpcode(u8)
Encountered an invalid opcode.
InvalidCloseSequence
The payload for the closing frame is invalid.
MessageTooLong
Received header is too long.
Message is bigger than the maximum allowed size.
UnmaskedFrameFromClient
The server must close the connection when an unmasked frame is received.
WriteBufferFull(Message)
Message write buffer is full.
SendAfterClosing
Not allowed to send after having sent a closing frame.
ReceivedAfterClosing
Remote sent data after sending a closing frame.
NonZeroReservedBits
Reserved bits in frame header are non-zero.
MaskedFrameFromServer
The client must close the connection when a masked frame is received.
FragmentedControlFrame
Control frames must not be fragmented.
ControlFrameTooBig
Control frames must have a payload of 125 bytes or less.
UnknownControlFrameType(u8)
Type of control frame not recognised.
ResetWithoutClosingHandshake
Connection closed without performing the closing handshake.
UnexpectedContinueFrame
Received a continue frame despite there being nothing to continue.
ExpectedFragment(OpCodeData)
Received data while waiting for more fragments.
UnknownDataFrameType(u8)
Type of data frame not recognised.
DeflateError(OpaqueError)
Error while applying the deflate extension
Implementations§
§impl ProtocolError
impl ProtocolError
pub fn is_connection_error(&self) -> bool
pub fn is_connection_error(&self) -> bool
Check if the error is a connection error, in which case the error can be ignored.
Trait Implementations§
§impl Debug for ProtocolError
impl Debug for ProtocolError
§impl Display for ProtocolError
impl Display for ProtocolError
§impl Error for ProtocolError
impl Error for ProtocolError
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
§impl From<DecodeError<'_>> for ProtocolError
impl From<DecodeError<'_>> for ProtocolError
§fn from(value: DecodeError<'_>) -> ProtocolError
fn from(value: DecodeError<'_>) -> ProtocolError
§impl From<Error> for ProtocolError
impl From<Error> for ProtocolError
§fn from(value: Error) -> ProtocolError
fn from(value: Error) -> ProtocolError
§impl From<Utf8Error> for ProtocolError
impl From<Utf8Error> for ProtocolError
§fn from(value: Utf8Error) -> ProtocolError
fn from(value: Utf8Error) -> ProtocolError
Auto Trait Implementations§
impl !Freeze for ProtocolError
impl !RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl !UnwindSafe for ProtocolError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<Error> ErrorExt for Error
impl<Error> ErrorExt for Error
§fn context<M>(self, context: M) -> OpaqueError
fn context<M>(self, context: M) -> OpaqueError
§fn with_context<C, F>(self, context: F) -> OpaqueError
fn with_context<C, F>(self, context: F) -> OpaqueError
§fn backtrace(self) -> OpaqueError
fn backtrace(self) -> OpaqueError
§fn into_opaque(self) -> OpaqueError
fn into_opaque(self) -> OpaqueError
OpaqueError
. Read more§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more§impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
type Error = <U as RamaTryFrom<T>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
type Error = <U as RamaTryFrom<T>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T> ToSmolStr for T
impl<T> ToSmolStr for T
fn to_smolstr(&self) -> SmolStr
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.