#[non_exhaustive]pub enum WsError {
Transport {
source: TransportError,
},
Decode {
context: String,
source: Error,
},
MissingArg {
raw: String,
},
Encode {
source: Error,
},
Configuration(String),
}Expand description
Errors from the WebSocket layer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Transport
A WebSocket transport error (connection, TLS, I/O, …).
Fields
§
source: TransportErrorFinding the position of the error
Decode
A WebSocket event or push payload could not be decoded.
Fields
MissingArg
A push event was missing the required arg field.
Encode
An outgoing WebSocket request could not be serialized.
Configuration(String)
The WebSocket client was used in an invalid way (wrong channel group, missing credentials, …).
Trait Implementations§
Source§impl Error for WsError
impl Error for WsError
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<TransportError> for WsError
impl From<TransportError> for WsError
Source§fn from(source: TransportError) -> Self
fn from(source: TransportError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for WsError
impl !UnwindSafe for WsError
impl Freeze for WsError
impl Send for WsError
impl Sync for WsError
impl Unpin for WsError
impl UnsafeUnpin for WsError
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