A versatile websocket client that supports many cryptocurrency exchanges.
```rust use cryptowsclient::{BinanceSpotWSClient, WSClient};
fn main() { let mut wsclient = BinanceSpotWSClient::new(Box::new(|msg| println!("{}", msg)), None); let channels = vec!["btcusdt@aggTrade".tostring(), "btcusdt@depth".tostring(),]; wsclient.subscribe(&channels); wsclient.run(None); wsclient.close(); } ```
src/clients/
Define a struct in the file, with the same name as the file.
Define a customized serialize_command()
.
Use define_client!
macro to implement the WSClient
trait.
handle_msg()
of ws_client_internal.rs
tests/
Add a new file under tests/
and put some integration tests in it.