You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works fine, however, I need to subscribe to a dynamic list of symbols (based on the app's settings).
let symbol_lst = vec!["BTCUSDT".to_string(), "BNBBUSD".to_string(), "BTCUSDT".to_string()];let lst = symbol_lst.iter().map(|x| BookTickerStream::from_symbol(&x)).collect::<Vec<_>>();// try 1
conn.subscribe(lst.into_iter().map(|x| x.into()));// ^^^^ the trait `From<BookTickerStream>` is not implemented for `&binance_spot_connector_rust::websocket::Stream`// try 2
conn.subscribe(lst.into_iter().map(|x| &x.into()));// returns a reference to data owned by the current function
Description
The issue comes from failing to convert BookTickerStream into stream (impl From<BookTickerStream> for Stream).
There is no public API to create websocket::Stream, so it is required to use the converter.
The text was updated successfully, but these errors were encountered:
Subscribing to multiple symbols can be done as follows:
It works fine, however, I need to subscribe to a dynamic list of symbols (based on the app's settings).
Description
The issue comes from failing to convert
BookTickerStream
into stream (impl From<BookTickerStream> for Stream
).There is no public API to create
websocket::Stream
, so it is required to use the converter.The text was updated successfully, but these errors were encountered: