Enum ws_stream_tungstenite::WsErr
source · #[non_exhaustive]pub enum WsErr {
Tungstenite {
source: Error,
},
Io {
source: Error,
},
Protocol,
ReceivedText,
Closed,
}
Expand description
The error type for errors happening in ws_stream_tungstenite.
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.
Tungstenite
A tungstenite error.
Io
An error from the underlying connection.
Protocol
A websocket protocol error. On read it means the remote didn’t respect the websocket protocol. On write this means there’s a bug in ws_stream_tungstenite and it will panic.
ReceivedText
We received a websocket text message. As we are about turning the websocket connection into a bytestream, this is probably unintended, and thus unsupported.
Closed
Trying to work with an connection that is closed. Only happens on writing. On reading
poll_read
will just return None
.
Trait Implementations§
source§impl Error for WsErr
impl Error for WsErr
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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 !RefUnwindSafe for WsErr
impl Send for WsErr
impl Sync for WsErr
impl Unpin for WsErr
impl !UnwindSafe for WsErr
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