pub enum WebSocketEvent {
Open {
protocol: String,
},
Text(String),
Binary(Vec<u8>),
Error(String),
Closed {
code: u16,
reason: String,
},
}Expand description
O que acontece numa conexão WebSocket.
Variants§
Open
Abriu (com o subprotocolo que o servidor escolheu, vazio se nenhum).
Text(String)
Binary(Vec<u8>)
Error(String)
Uma falha (não abriu, caiu); o Closed vem depois.
Closed
Fechou (o código e o motivo; 1006 quando caiu sem o fechamento do protocolo). É sempre o último evento da conexão.
Trait Implementations§
Source§impl Clone for WebSocketEvent
impl Clone for WebSocketEvent
Source§impl Debug for WebSocketEvent
impl Debug for WebSocketEvent
Source§impl PartialEq for WebSocketEvent
impl PartialEq for WebSocketEvent
impl StructuralPartialEq for WebSocketEvent
Auto Trait Implementations§
impl Forget for WebSocketEvent
impl Freeze for WebSocketEvent
impl Move for WebSocketEvent
impl RefUnwindSafe for WebSocketEvent
impl Send for WebSocketEvent
impl Sync for WebSocketEvent
impl Unpin for WebSocketEvent
impl UnsafeUnpin for WebSocketEvent
impl UnwindSafe for WebSocketEvent
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