pub enum ProtocolError {
Show 19 variants
Utf8(BoxError),
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(BoxError),
}Expand description
Indicates the specific type/cause of a protocol error.
Variants§
Utf8(BoxError)
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.
Fields
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(BoxError)
Error while applying the deflate extension
Implementations§
Source§impl ProtocolError
impl ProtocolError
Sourcepub 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§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
Source§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
use the Display impl or to_string()
Source§impl From<DecodeError<'_>> for ProtocolError
impl From<DecodeError<'_>> for ProtocolError
Source§fn from(value: DecodeError<'_>) -> Self
fn from(value: DecodeError<'_>) -> Self
Source§impl From<Error> for ProtocolError
impl From<Error> for ProtocolError
Auto Trait Implementations§
impl !Freeze for ProtocolError
impl !RefUnwindSafe for ProtocolError
impl !UnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnsafeUnpin for ProtocolError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<Error> ErrorExt for Error
impl<Error> ErrorExt for Error
Source§fn into_box_error(self) -> Box<dyn Error + Sync + Send>
fn into_box_error(self) -> Box<dyn Error + Sync + Send>
BoxError without additional context.Source§fn into_opaque_error(self) -> OpaqueError
fn into_opaque_error(self) -> OpaqueError
OpaqueError without additional context. Read moreSource§fn context_debug<M>(self, value: M) -> Box<dyn Error + Sync + Send>
fn context_debug<M>(self, value: M) -> Box<dyn Error + Sync + Send>
fmt::Debug as fmt::Display.Source§fn context_field<M>(
self,
key: &'static str,
value: M,
) -> Box<dyn Error + Sync + Send>
fn context_field<M>( self, key: &'static str, value: M, ) -> Box<dyn Error + Sync + Send>
Source§fn context_str_field<M>(
self,
key: &'static str,
value: M,
) -> Box<dyn Error + Sync + Send>
fn context_str_field<M>( self, key: &'static str, value: M, ) -> Box<dyn Error + Sync + Send>
Self::context_field but using a string-like value,
this is useful in case you need to pass a string slice which is borrowed
and thus cannot be passed as part of ’static error.Source§fn context_hex_field<M>(
self,
key: &'static str,
value: M,
) -> Box<dyn Error + Sync + Send>
fn context_hex_field<M>( self, key: &'static str, value: M, ) -> Box<dyn Error + Sync + Send>
Source§fn context_debug_field<M>(
self,
key: &'static str,
value: M,
) -> Box<dyn Error + Sync + Send>
fn context_debug_field<M>( self, key: &'static str, value: M, ) -> Box<dyn Error + Sync + Send>
fmt::Debug as fmt::Display.Source§fn with_context<C, F>(self, cb: F) -> Box<dyn Error + Sync + Send>
fn with_context<C, F>(self, cb: F) -> Box<dyn Error + Sync + Send>
Source§fn with_context_debug<C, F>(self, cb: F) -> Box<dyn Error + Sync + Send>
fn with_context_debug<C, F>(self, cb: F) -> Box<dyn Error + Sync + Send>
fmt::Debug as fmt::Display.Source§fn with_context_field<C, F>(
self,
key: &'static str,
cb: F,
) -> Box<dyn Error + Sync + Send>
fn with_context_field<C, F>( self, key: &'static str, cb: F, ) -> Box<dyn Error + Sync + Send>
Source§fn with_context_str_field<C, F>(
self,
key: &'static str,
cb: F,
) -> Box<dyn Error + Sync + Send>
fn with_context_str_field<C, F>( self, key: &'static str, cb: F, ) -> Box<dyn Error + Sync + Send>
Self::with_context_field but using a string-like value,
this is useful in case you need to pass a string slice which is borrowed
and thus cannot be passed as part of ’static error.Source§fn with_context_hex_field<C, F>(
self,
key: &'static str,
cb: F,
) -> Box<dyn Error + Sync + Send>
fn with_context_hex_field<C, F>( self, key: &'static str, cb: F, ) -> Box<dyn Error + Sync + Send>
Source§fn with_context_debug_field<C, F>(
self,
key: &'static str,
cb: F,
) -> Box<dyn Error + Sync + Send>
fn with_context_debug_field<C, F>( self, key: &'static str, cb: F, ) -> Box<dyn Error + Sync + Send>
fmt::Debug as fmt::Display.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
Source§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.
Source§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writerSource§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writerSource§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writerSource§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writerSource§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer