Expand description
Decoding indicative_market_data frames, batched or not.
crate::WsClient::subscribe_indicative_market_data subscribes to
indicative_market_data_v2, whose IndicativeMarketDataBatch frames each
hold several rows oldest first. With batching disabled, or against a server
that predates the v2 channel, it uses indicative_market_data, where each
row arrives as its own IndicativeMarketData frame. The helpers here return the rows in delivery order either way, so
applying them in order gives the same per-instrument state regardless of
framing.
use hypercall_client::indicative::decode_indicative_rows;
let frame = r#"{"type":"IndicativeMarketDataBatch","flushed_at":2,"updates":[
{"instrument":"BTC-20261002-87000-C","best_bid":"14.79","best_ask":"133.88",
"num_providers":1,"published_at":1,"timestamp":1}]}"#;
let rows = decode_indicative_rows(frame).unwrap().expect("indicative frame");
assert_eq!(rows[0].instrument, "BTC-20261002-87000-C");Functionsยง
- decode_
indicative_ rows - Decode one text frame and return its indicative rows, or
Nonefor any other message type. - indicative_
rows - Rows carried by one server message, or
Noneif it is not indicative market data. - indicative_
rows_ from_ value decode_indicative_rowsfor a message already collected bycrate::WsClient(seecrate::WsClient::get_messages).