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.