pub trait WsWriter {
fn send_text<T: Into<Binary>>(&mut self, text: T);
fn send_binary<B: Into<Binary>>(&mut self, data: B);
fn send_ping(&mut self, message: &str);
fn send_pong(&mut self, message: &str);
fn send_close(&mut self, reason: Option<CloseReason>);
}
Expand description
Common writing methods for a websocket.
Required Methods
sourcefn send_binary<B: Into<Binary>>(&mut self, data: B)
fn send_binary<B: Into<Binary>>(&mut self, data: B)
Send a binary
sourcefn send_close(&mut self, reason: Option<CloseReason>)
fn send_close(&mut self, reason: Option<CloseReason>)
Close the connection