pub enum SubscribeCommand {
Show 16 variants
Data(SubscribeCustomData),
Instrument(SubscribeInstrument),
Instruments(SubscribeInstruments),
BookDeltas(SubscribeBookDeltas),
BookDepth(SubscribeBookDepth),
BookSnapshots(SubscribeBookSnapshots),
Quotes(SubscribeQuotes),
Trades(SubscribeTrades),
Bars(SubscribeBars),
MarkPrices(SubscribeMarkPrices),
IndexPrices(SubscribeIndexPrices),
FundingRates(SubscribeFundingRates),
InstrumentStatus(SubscribeInstrumentStatus),
InstrumentClose(SubscribeInstrumentClose),
OptionGreeks(SubscribeOptionGreeks),
OptionChain(SubscribeOptionChain),
}Variants§
Data(SubscribeCustomData)
Instrument(SubscribeInstrument)
Instruments(SubscribeInstruments)
BookDeltas(SubscribeBookDeltas)
BookDepth(SubscribeBookDepth)
BookSnapshots(SubscribeBookSnapshots)
Quotes(SubscribeQuotes)
Trades(SubscribeTrades)
Bars(SubscribeBars)
MarkPrices(SubscribeMarkPrices)
IndexPrices(SubscribeIndexPrices)
FundingRates(SubscribeFundingRates)
InstrumentStatus(SubscribeInstrumentStatus)
InstrumentClose(SubscribeInstrumentClose)
OptionGreeks(SubscribeOptionGreeks)
OptionChain(SubscribeOptionChain)
Implementations§
Source§impl SubscribeCommand
impl SubscribeCommand
Sourcepub fn validate_routing(&self, cache: &Cache) -> Result<()>
pub fn validate_routing(&self, cache: &Cache) -> Result<()>
Validates list routing before subscription ownership is retained.
§Errors
Returns an error if an identifier or bar list is invalid or trade routes are mixed. For non-external clients, also rejects mixed quote routes and unsupported lists with multiple IDs containing synthetic members.
Sourcepub fn instrument_ids(&self) -> Option<&[InstrumentId]>
pub fn instrument_ids(&self) -> Option<&[InstrumentId]>
Returns the instrument IDs for an instrument subscription, if applicable.
Sourcepub fn with_instrument_ids(
&self,
instrument_ids: impl IntoInstrumentIds,
) -> Option<Self>
pub fn with_instrument_ids( &self, instrument_ids: impl IntoInstrumentIds, ) -> Option<Self>
Projects an instrument subscription onto the supplied IDs, preserving its metadata.
§Panics
Panics if an instrument subscription receives an empty identifier list.
Sourcepub fn bar_types(&self) -> Option<&[BarType]>
pub fn bar_types(&self) -> Option<&[BarType]>
Returns the bar types for a bar subscription, if applicable.
Sourcepub fn with_bar_types(&self, bar_types: impl IntoBarTypes) -> Option<Self>
pub fn with_bar_types(&self, bar_types: impl IntoBarTypes) -> Option<Self>
Projects a bar subscription onto the supplied types, preserving its metadata.
§Panics
Panics if a bar subscription receives an empty list.
Sourcepub fn into_unsubscribe(
self,
command_id: UUID4,
ts_init: UnixNanos,
correlation_id: Option<UUID4>,
) -> UnsubscribeCommand
pub fn into_unsubscribe( self, command_id: UUID4, ts_init: UnixNanos, correlation_id: Option<UUID4>, ) -> UnsubscribeCommand
Converts this subscribe command into its matching unsubscribe command.
Preserves the subscribed data identity and client route while replacing the command ID and initialization timestamp. It also preserves parameters and sets the supplied correlation ID when the matching unsubscribe command supports those fields.