pub enum WebSocketError {
Show 15 variants
Other(String),
Listen(String),
ConnectionTimeout,
MalformedHandshake,
MalformedMessage,
NegotiationFailure,
NegotiationFailureWithReason(String),
ResponseChannelError(SendError<Message>),
WebSocketError(Box<Error>),
AbnormalClose,
ServerClose,
Stop(String),
Done(String),
Join(String),
IoError(Error),
}Expand description
Errors produced by the WebSocketServer.
Variants§
Other(String)
A generic, miscellaneous error carrying a descriptive message.
Listen(String)
The server failed to bind and listen on the requested address.
ConnectionTimeout
Indicates that no messages have been received within the specified timeout period
MalformedHandshake
Indicates that the data received is not a valid handshake message
MalformedMessage
Indicates that the data received is not a valid or acceptable message
NegotiationFailure
Indicates handler negotiation failure This error code is reserved for structs implementing WebSocket handler.
NegotiationFailureWithReason(String)
Indicates handler negotiation failure with a specific reason This error code is reserved for structs implementing WebSocket handler.
ResponseChannelError(SendError<Message>)
Error sending response via the tokio MPSC response channel
WebSocketError(Box<Error>)
WebSocket error produced by the underlying Tungstenite WebSocket crate
AbnormalClose
Connection terminated abnormally
ServerClose
Server closed connection
Stop(String)
Failure while signaling the listener to stop.
Done(String)
Failure while signaling that the listener has finished shutting down.
Join(String)
Failure while waiting for the listener to shut down.
IoError(Error)
An underlying I/O error.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !Freeze for Error
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.