[−][src]Trait crypto_ws_client::WSClient
The public interface of every WebSocket client.
Associated Types
Loading content...Required methods
pub fn init(on_msg: fn(_: String), url: Option<&str>) -> Self::Exchange
[src]
Create a new client.
Arguments
on_msg
- The message handlerurl
- Optional server url, usually you don't need specify it
pub fn subscribe(&mut self, channels: &[String])
[src]
Subscribe channels.
pub fn unsubscribe(&mut self, channels: &[String])
[src]
Unsubscribe channels.
pub fn run(&mut self)
[src]
Start the infinite loop until the server closes the connection.
pub fn close(&mut self)
[src]
Close the client.