Enum async_proto::ErrorContext
source · pub enum ErrorContext {
Show 15 variants
Custom(String),
BuiltIn {
for_type: &'static str,
},
WebSocket {
source: Box<Self>,
},
WebSocketSink,
WebSocketStream,
DefaultImpl,
Derived {
for_type: &'static str,
},
EnumDiscrim {
source: Box<Self>,
},
UnnamedField {
idx: usize,
source: Box<Self>,
},
NamedField {
name: &'static str,
source: Box<Self>,
},
FromStr,
AsString {
source: Box<Self>,
},
TryInto,
Via {
source: Box<Self>,
},
Bitflags {
source: Box<Self>,
},
}Expand description
Provides additional information about the origin of an error.
Variants§
Custom(String)
An error context you can use when manually implementing Protocol.
BuiltIn
The error was produced by a Protocol implementation defined in the async-proto crate.
Fields
WebSocket
The error occurred while reading/writing a WebSocket message.
Fields
WebSocketSink
The error was produced by a sink returned from async_proto::websocket.
WebSocketStream
The error was produced by a stream returned from async_proto::websocket.
DefaultImpl
The error was produced by the default implementation of a Protocol trait method.
Derived
The error was produced by an automatically derived Protocol implementation.
EnumDiscrim
The error occurred while reading/writing the discriminant of an enum.
Fields
UnnamedField
The error occurred while reading/writing a field of a tuple, tuple struct, or tuple enum variant.
Fields
NamedField
The error occurred while reading/writing a field of a struct or struct enum variant.
Fields
FromStr
The error occurred in the FromStr implementation of a type whose Protocol implementation was derived with #[async_proto(as_string)].
AsString
The error occurred while reading/writing a string representing a type whose Protocol implementation was derived with #[async_proto(as_string)].
TryInto
The error occurred in the TryInto implementation for a type whose Protocol implementation was derived with #[async_proto(via = ...)].
Via
The error occurred while reading/writing a proxy type representing a type whose Protocol implementation was derived with #[async_proto(via ...)].
Fields
Bitflags
The error was produced by the async_proto::bitflags macro.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl UnwindSafe for ErrorContext
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
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