Enum tungstenite::error::Error [−][src]
Possible WebSocket errors
Variants
WebSocket connection closed normally. This informs you of the close. It’s not an error as such and nothing wrong happened.
This is returned as soon as the close handshake is finished (we have both sent and received a close frame) on the server end and as soon as the server has closed the underlying connection if this endpoint is a client.
Thus when you receive this, it is safe to drop the underlying connection.
Receiving this error means that the WebSocket object is not usable anymore and the only meaningful action with it is dropping it.
Trying to work with already closed connection.
Trying to read or write after receiving ConnectionClosed
causes this.
As opposed to ConnectionClosed
, this indicates your code tries to operate on the
connection when it really shouldn’t anymore, so this really indicates a programmer
error on your part.
Io(Error)
Input-output error. Apart from WouldBlock, these are generally errors with the underlying connection and you should probably consider them fatal.
Tls(Error)
TLS error
- When reading: buffer capacity exhausted.
- When writing: your message is bigger than the configured max message size (64MB by default).
Protocol violation.
SendQueueFull(Message)
Message send queue full.
UTF coding error
Invalid URL.
Http(StatusCode)
HTTP error.
HttpFormat(Error)
HTTP format error.
Trait Implementations
impl Debug for Error
[src]
impl Display for Error
[src]
impl Error for Error
[src]
fn description(&self) -> &str
[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<Error> for Error
[src]
impl From<Error> for Error
[src]
impl From<Error> for Error
[src]
impl From<Error> for Error
[src]
impl<Role: HandshakeRole> From<Error> for HandshakeError<Role>
[src]
impl From<FromUtf8Error> for Error
[src]
fn from(_: FromUtf8Error) -> Self
[src]
impl From<InvalidHeaderName> for Error
[src]
fn from(err: InvalidHeaderName) -> Self
[src]
impl From<InvalidHeaderValue> for Error
[src]
fn from(err: InvalidHeaderValue) -> Self
[src]
impl From<InvalidStatusCode> for Error
[src]
fn from(err: InvalidStatusCode) -> Self
[src]
impl From<InvalidUri> for Error
[src]
fn from(err: InvalidUri) -> Self
[src]
impl From<ToStrError> for Error
[src]
fn from(_: ToStrError) -> Self
[src]
impl From<Utf8Error> for Error
[src]
impl NonBlockingError for Error
[src]
fn into_non_blocking(self) -> Option<Self>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,