pub enum WebSocketError {
InvalidUpgrade(String),
HandshakeFailed(String),
ConnectionClosed,
SendFailed(String),
ReceiveFailed(String),
SerializationError(String),
DeserializationError(String),
ProtocolError(String),
IoError(Error),
Tungstenite(Error),
}Expand description
Error type for WebSocket operations
Variants§
InvalidUpgrade(String)
Invalid WebSocket upgrade request
HandshakeFailed(String)
WebSocket handshake failed
ConnectionClosed
Connection closed unexpectedly
SendFailed(String)
Failed to send message
ReceiveFailed(String)
Failed to receive message
SerializationError(String)
Message serialization error
DeserializationError(String)
Message deserialization error
ProtocolError(String)
Protocol error
IoError(Error)
IO error
Tungstenite(Error)
Tungstenite error
Implementations§
Source§impl WebSocketError
impl WebSocketError
Sourcepub fn invalid_upgrade(msg: impl Into<String>) -> Self
pub fn invalid_upgrade(msg: impl Into<String>) -> Self
Create an invalid upgrade error
Sourcepub fn handshake_failed(msg: impl Into<String>) -> Self
pub fn handshake_failed(msg: impl Into<String>) -> Self
Create a handshake failed error
Sourcepub fn send_failed(msg: impl Into<String>) -> Self
pub fn send_failed(msg: impl Into<String>) -> Self
Create a send failed error
Sourcepub fn receive_failed(msg: impl Into<String>) -> Self
pub fn receive_failed(msg: impl Into<String>) -> Self
Create a receive failed error
Sourcepub fn serialization_error(msg: impl Into<String>) -> Self
pub fn serialization_error(msg: impl Into<String>) -> Self
Create a serialization error
Sourcepub fn deserialization_error(msg: impl Into<String>) -> Self
pub fn deserialization_error(msg: impl Into<String>) -> Self
Create a deserialization error
Sourcepub fn protocol_error(msg: impl Into<String>) -> Self
pub fn protocol_error(msg: impl Into<String>) -> Self
Create a protocol error
Trait Implementations§
Source§impl Debug for WebSocketError
impl Debug for WebSocketError
Source§impl Display for WebSocketError
impl Display for WebSocketError
Source§impl Error for WebSocketError
impl Error for WebSocketError
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<Error> for WebSocketError
impl From<Error> for WebSocketError
Source§impl From<Error> for WebSocketError
impl From<Error> for WebSocketError
Source§impl From<WebSocketError> for ApiError
impl From<WebSocketError> for ApiError
Source§fn from(err: WebSocketError) -> Self
fn from(err: WebSocketError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for WebSocketError
impl !RefUnwindSafe for WebSocketError
impl Send for WebSocketError
impl Sync for WebSocketError
impl Unpin for WebSocketError
impl !UnwindSafe for WebSocketError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ValidateIp for Twhere
T: ToString,
impl<T> ValidateIp for Twhere
T: ToString,
Source§fn validate_ipv4(&self) -> bool
fn validate_ipv4(&self) -> bool
Validates whether the given string is an IP V4
Source§fn validate_ipv6(&self) -> bool
fn validate_ipv6(&self) -> bool
Validates whether the given string is an IP V6
Source§fn validate_ip(&self) -> bool
fn validate_ip(&self) -> bool
Validates whether the given string is an IP