pub enum Error {
UrlParse {
url: String,
source: ParseError,
},
WebsocketError(Error),
WebsocketClosed,
UnexpectedMessageType(Message),
SerializationError(Error),
SocketeerDroppedWithoutClosing,
}
Expand description
Error type for the Socketeer library. This type is used to represent all possible external errors that can occur when using the Socketeer library.
Variants§
UrlParse
Url Parse Error
Fields
§
source: ParseError
The source of the error, from the URL crate
WebsocketError(Error)
Websocket Error Error thrown by the Tungstenite library when there is an issue with the websocket connection.
WebsocketClosed
Socketeer error when the websocket connection is closed unexpectedly.
UnexpectedMessageType(Message)
Error thrown if a message type not handled by socketeer
is received.
SerializationError(Error)
Error thrown if the message received fails to serialize or deserialize.
SocketeerDroppedWithoutClosing
Error thrown if socketeer is dropped without closing the connection. This error will be removed once async destructors are stabilized. See issue
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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