pub fn crawl_trade(
    exchange: &str,
    market_type: MarketType,
    symbols: Option<&[String]>,
    on_msg: Arc<Mutex<dyn FnMut(Message) + 'static + Send>>,
    duration: Option<u64>,
) {
    let func = match exchange {
        "binance" => crawlers::binance::crawl_trade,
        "bitfinex" => crawlers::bitfinex::crawl_trade,
        "bitget" => crawlers::bitget::crawl_trade,
        "bithumb" => crawlers::bithumb::crawl_trade,
        "bitmex" => crawlers::bitmex::crawl_trade,
        "bitstamp" => crawlers::bitstamp::crawl_trade,
        "bitz" => crawlers::bitz::crawl_trade,
        "bybit" => crawlers::bybit::crawl_trade,
        "coinbase_pro" => crawlers::coinbase_pro::crawl_trade,
        "deribit" => crawlers::deribit::crawl_trade,
        "ftx" => crawlers::ftx::crawl_trade,
        "gate" => crawlers::gate::crawl_trade,
        "huobi" => crawlers::huobi::crawl_trade,
        "kraken" => crawlers::kraken::crawl_trade,
        "kucoin" => crawlers::kucoin::crawl_trade,
        "mxc" => crawlers::mxc::crawl_trade,
        "okex" => crawlers::okex::crawl_trade,
        "zbg" => crawlers::zbg::crawl_trade,
        _ => panic!("Unknown exchange {}", exchange),
    };
    let handle = func(market_type, symbols, on_msg, duration);
    if let Some(h) = handle {
        h.join().expect("The thread panicked");
    }
}
/// Crawl realtime trades.
///
/// If `symbols` is None, this function will crawl all trading symbols in the `market_type`,
/// and fetch the latest symbols every hour.
Crawl realtime trades.
If `symbols` is None, this function will crawl all trading symbols in the `market_type`,
and fetch the latest symbols every hour.
Crawl realtime trades . If ` symbols ` is None this function will crawl all trading symbols in the ` market_type ` and fetch the latest symbols every hour .
pub fn crawl_trade(
    exchange: &str,
    market_type: MarketType,
    symbols: Option<&[String]>,
    on_msg: Arc<Mutex<dyn FnMut(Message) + 'static + Send>>,
    duration: Option<u64>,
) {
    let func = match exchange {
        "binance" => crawlers::binance::crawl_trade,
        "bitfinex" => crawlers::bitfinex::crawl_trade,
        "bitget" => crawlers::bitget::crawl_trade,
        "bithumb" => crawlers::bithumb::crawl_trade,
        "bitmex" => crawlers::bitmex::crawl_trade,
        "bitstamp" => crawlers::bitstamp::crawl_trade,
        "bitz" => crawlers::bitz::crawl_trade,
        "bybit" => crawlers::bybit::crawl_trade,
        "coinbase_pro" => crawlers::coinbase_pro::crawl_trade,
        "deribit" => crawlers::deribit::crawl_trade,
        "ftx" => crawlers::ftx::crawl_trade,
        "gate" => crawlers::gate::crawl_trade,
        "huobi" => crawlers::huobi::crawl_trade,
        "kraken" => crawlers::kraken::crawl_trade,
        "kucoin" => crawlers::kucoin::crawl_trade,
        "mxc" => crawlers::mxc::crawl_trade,
        "okex" => crawlers::okex::crawl_trade,
        "zbg" => crawlers::zbg::crawl_trade,
        _ => panic!("Unknown exchange {}", exchange),
    };
    let handle = func(market_type, symbols, on_msg, duration);
    if let Some(h) = handle {
        h.join().expect("The thread panicked");
    }
}
pub fn crawl_trade ( exchange : & str , market_type : MarketType , symbols : Option < & [ String ] > , on_msg : Arc < Mutex < dyn FnMut ( Message ) + ' static + Send > > , duration : Option < u64 > , ) { let func = match exchange { " " => crawlers :: binance :: crawl_trade , " " => crawlers :: bitfinex :: crawl_trade , " " => crawlers :: bitget :: crawl_trade , " " => crawlers :: bithumb :: crawl_trade , " " => crawlers :: bitmex :: crawl_trade , " " => crawlers :: bitstamp :: crawl_trade , " " => crawlers :: bitz :: crawl_trade , " " => crawlers :: bybit :: crawl_trade , " " => crawlers :: coinbase_pro :: crawl_trade , " " => crawlers :: deribit :: crawl_trade , " " => crawlers :: ftx :: crawl_trade , " " => crawlers :: gate :: crawl_trade , " " => crawlers :: huobi :: crawl_trade , " " => crawlers :: kraken :: crawl_trade , " " => crawlers :: kucoin :: crawl_trade , " " => crawlers :: mxc :: crawl_trade , " " => crawlers :: okex :: crawl_trade , " " => crawlers :: zbg :: crawl_trade , _ => panic ! ( " " exchange ) , } ; let handle = func ( market_type , symbols , on_msg , duration ) ; if let Some ( h ) = handle { h . join ( ) . expect ( " " ) ; } }
Crawl realtime trades.
Crawl realtime trades .
exchange
&str
market_type
MarketType
symbols
Option<&[String]>
on_msg
Arc<Mutex<dyn FnMut(Message) + 'static + Send>>
duration
Option<u64>