pub enum WsError {
Protocol(String),
TooLarge {
size: usize,
limit: usize,
},
InvalidUtf8,
Idle,
Full,
Closed,
Io(Error),
}Variants§
Protocol(String)
The peer broke the framing rules: a reserved bit set, an unmasked client frame, a continuation that started nothing.
TooLarge
A frame or a reassembled message exceeded the configured limit.
InvalidUtf8
A text frame whose payload was not valid UTF-8. RFC 6455 is explicit that this closes with 1007 rather than being passed to the application.
Idle
The peer stopped answering pings within the idle timeout.
Full
The peer’s send queue is full: it is not reading fast enough to keep up. The only safe answer is to drop it, so this is a distinct variant rather than an I/O error.
Closed
The connection is already closed, so there is nothing to send on.
Io(Error)
Implementations§
Trait Implementations§
Source§impl Error for WsError
impl Error for WsError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for WsError
impl !UnwindSafe for WsError
impl Freeze for WsError
impl Send for WsError
impl Sync for WsError
impl Unpin for WsError
impl UnsafeUnpin for WsError
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