pub enum WsClientError {
Show 15 variants
Config(WsConfigError),
InvalidRequest(EncodeError),
InvalidResponse(DecodeError),
InvalidResponseStatus(StatusCode),
InvalidUpgradeHeader,
InvalidConnectionHeader(HeaderValue),
MissingConnectionHeader,
MissingWebSocketAcceptHeader,
InvalidChallengeResponse(String, HeaderValue),
InvalidWebSocketProtocol(HeaderValue),
UnexpectedWebSocketExtensions(HeaderValue),
Protocol(ProtocolError),
Timeout,
Connect(ConnectError),
Disconnected(Option<Error>),
}Expand description
Errors produced while establishing or using a WebSocket client connection.
Variants§
Config(WsConfigError)
Invalid client configuration.
InvalidRequest(EncodeError)
Invalid request
InvalidResponse(DecodeError)
Invalid response
InvalidResponseStatus(StatusCode)
Invalid response status
InvalidUpgradeHeader
Invalid upgrade header
InvalidConnectionHeader(HeaderValue)
Invalid connection header
MissingConnectionHeader
Missing CONNECTION header
MissingWebSocketAcceptHeader
Missing SEC-WEBSOCKET-ACCEPT header
InvalidChallengeResponse(String, HeaderValue)
Invalid challenge response
InvalidWebSocketProtocol(HeaderValue)
The server selected an invalid or unrequested WebSocket subprotocol.
UnexpectedWebSocketExtensions(HeaderValue)
The server returned an extension that the client did not offer.
Protocol(ProtocolError)
Protocol error
Timeout
The opening handshake timed out.
Connect(ConnectError)
Failed to connect to host
Disconnected(Option<Error>)
Connector has been disconnected
Trait Implementations§
Source§impl Clone for WsClientError
impl Clone for WsClientError
Source§impl Debug for WsClientError
impl Debug for WsClientError
Source§impl Display for WsClientError
impl Display for WsClientError
Source§impl Error for WsClientError
impl Error for WsClientError
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 ErrorDiagnostic for WsClientError
impl ErrorDiagnostic for WsClientError
Source§impl From<ConnectError> for WsClientError
impl From<ConnectError> for WsClientError
Source§fn from(source: ConnectError) -> Self
fn from(source: ConnectError) -> Self
Converts to this type from the input type.
Source§impl From<DecodeError> for WsClientError
impl From<DecodeError> for WsClientError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<Either<DecodeError, Error>> for WsClientError
impl From<Either<DecodeError, Error>> for WsClientError
Source§impl From<Either<EncodeError, Error>> for WsClientError
impl From<Either<EncodeError, Error>> for WsClientError
Source§impl From<EncodeError> for WsClientError
impl From<EncodeError> for WsClientError
Source§fn from(source: EncodeError) -> Self
fn from(source: EncodeError) -> Self
Converts to this type from the input type.
Source§impl From<ProtocolError> for WsClientError
impl From<ProtocolError> for WsClientError
Source§fn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Converts to this type from the input type.
Source§impl From<WsConfigError> for WsClientError
impl From<WsConfigError> for WsClientError
Source§fn from(source: WsConfigError) -> Self
fn from(source: WsConfigError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for WsClientError
impl !UnwindSafe for WsClientError
impl Freeze for WsClientError
impl Send for WsClientError
impl Sync for WsClientError
impl Unpin for WsClientError
impl UnsafeUnpin for WsClientError
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