[−][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, duration: Option<u64>)[src]
Start the infinite loop until the server closes the connection.
Arguments
duration- How many seconds to run, None means infinite.
pub fn close(&mut self)[src]
Close the client.