pub enum WebSocketError {
Show 28 variants
Custom(String),
JsValue(Sendable<Printable>),
PoisonError,
MissingUrl,
AddressSchema(String),
InvalidMessageType,
InvalidState(u16),
DataEncoding,
DataType,
AlreadyInitialized,
AlreadyConnected,
NotConnected,
Connect(String),
NegotiationFailure,
DispatchChannelAck,
ChannelSend,
DispatchChannelTrySend,
DispatcherSignal,
ReceiveChannel,
ConnectChannel,
Callback(CallbackError),
Task(TaskError),
Tungstenite(Box<Error>),
ReceiverCtlSend(SendError<Message>),
WorkflowWasm(Error),
ConnectionTimeout,
InvalidConnectStrategyArg(String),
InvalidConnectStrategy,
}Expand description
Errors produced by the WebSocket client.
Variants§
Custom(String)
A custom, free-form error message.
JsValue(Sendable<Printable>)
An error originating from the JavaScript/WASM boundary.
PoisonError
A mutex was poisoned due to a panic in another thread.
MissingUrl
No URL was supplied via the constructor, connect(), or a resolver.
AddressSchema(String)
The supplied URL does not use the ws:// or wss:// scheme.
InvalidMessageType
A received message was of an unsupported or unexpected type.
InvalidState(u16)
The socket was in an invalid ready state (value carried) for the operation.
DataEncoding
Message payload could not be encoded.
DataType
The message data was of an unexpected type.
AlreadyInitialized
The connection has already been initialized.
AlreadyConnected
The WebSocket is already connected.
NotConnected
The WebSocket is not currently connected.
Connect(String)
Connection to the given URL could not be established.
NegotiationFailure
The custom handshake negotiation failed.
DispatchChannelAck
Failed to receive an acknowledgement on the dispatch channel.
ChannelSend
A channel send operation failed.
DispatchChannelTrySend
A non-blocking dispatch channel try_send failed.
DispatcherSignal
Failed to signal the dispatcher task.
ReceiveChannel
The receive channel failed.
ConnectChannel
The connect-notification channel failed.
Callback(CallbackError)
An error originating from a WASM callback.
Task(TaskError)
An error originating from the task subsystem.
Tungstenite(Box<Error>)
An error from the native tungstenite WebSocket implementation.
ReceiverCtlSend(SendError<Message>)
Failed to relay a control message to the receiver.
WorkflowWasm(Error)
An error originating from the workflow-wasm crate.
ConnectionTimeout
The connection attempt timed out.
InvalidConnectStrategyArg(String)
The supplied connect-strategy argument was invalid.
InvalidConnectStrategy
The configured connect strategy was invalid.
Implementations§
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()
Source§impl From<CallbackError> for Error
impl From<CallbackError> for Error
Source§fn from(source: CallbackError) -> Error
fn from(source: CallbackError) -> Error
Source§impl From<Error> for Error
impl From<Error> for Error
Source§fn from(source: WebSocketError) -> Self
fn from(source: WebSocketError) -> Self
Source§impl From<Error> for ServerError
impl From<Error> for ServerError
Source§impl<T> From<PoisonError<T>> for Error
impl<T> From<PoisonError<T>> for Error
Source§fn from(_: PoisonError<T>) -> Error
fn from(_: PoisonError<T>) -> Error
Source§impl<T> From<TrySendError<T>> for Error
impl<T> From<TrySendError<T>> for Error
Source§fn from(_error: TrySendError<T>) -> Error
fn from(_error: TrySendError<T>) -> Error
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze 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.