binance / binance-spot-connector-rust

MIT License
109 stars 39 forks source link

add subscription from slice of Streams #10

Closed raeisimv closed 1 week ago

raeisimv commented 7 months ago

Now, it is possible to use a dynamic list of symbols for subscribing.

let symbol_lst = vec!["BTCUSDT".to_string(), "BNBBUSD".to_string(), "BTCUSDT".to_string()];

let lst = symbol_lst.iter()
    .map(|x| BookTickerStream::from_symbol(&x).into())
    .collect::<Vec<_>>()
    ;
conn.subscribe_from_slice(&lst);

fixes #9