pub struct SubscriptionSet { /* private fields */ }Expand description
Declarative subscription request — built up fluently, consumed by
crate::Station::subscribe.
Implementations§
Source§impl SubscriptionSet
impl SubscriptionSet
pub fn new() -> Self
Sourcepub fn add(
self,
exchange: ExchangeId,
symbol: impl Into<String>,
account_type: AccountType,
streams: impl IntoIterator<Item = Stream>,
) -> Self
pub fn add( self, exchange: ExchangeId, symbol: impl Into<String>, account_type: AccountType, streams: impl IntoIterator<Item = Stream>, ) -> Self
Add a subscription. symbol is canonical (e.g. "BTC-USDT",
"BTCUSDT", "BTC/USDT") — it is parsed into a canonical
Symbol and translated to the exchange-native form via
SymbolNormalizer. Use Self::add_raw for instrument IDs that
don’t fit the canonical BASE-QUOTE shape (Deribit options,
exchange-specific futures suffixes, etc.).
Sourcepub fn add_raw(
self,
exchange: ExchangeId,
symbol: impl Into<String>,
account_type: AccountType,
streams: impl IntoIterator<Item = Stream>,
) -> Self
pub fn add_raw( self, exchange: ExchangeId, symbol: impl Into<String>, account_type: AccountType, streams: impl IntoIterator<Item = Stream>, ) -> Self
Add a subscription with a raw exchange-native symbol. symbol is
passed through to the connector verbatim — no SymbolNormalizer
translation. Use for instrument IDs that don’t fit the canonical
BASE-QUOTE shape:
- Deribit options:
"BTC-23MAY26-86000-C" - Futures with date suffix:
"BTCUSDT_240329" - Index symbols:
".DEFI","BTCUSD-PERP"
The caller is responsible for using the exact wire format the
exchange expects — Event.symbol on the handle will mirror the
raw string back.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for SubscriptionSet
impl Clone for SubscriptionSet
Source§fn clone(&self) -> SubscriptionSet
fn clone(&self) -> SubscriptionSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more