pub struct DataActorCore {
pub actor_id: ActorId,
pub config: DataActorConfig,
/* private fields */
}Expand description
Core functionality for all actors.
Fields§
§actor_id: ActorIdThe actor identifier.
config: DataActorConfigThe actors configuration.
Implementations§
Source§impl DataActorCore
impl DataActorCore
Sourcepub fn new(config: DataActorConfig) -> Self
pub fn new(config: DataActorConfig) -> Self
Creates a new DataActorCore instance.
Sourcepub fn registered_indicators(&self) -> Vec<SharedActorIndicator> ⓘ
pub fn registered_indicators(&self) -> Vec<SharedActorIndicator> ⓘ
Returns the registered indicators.
Sourcepub fn indicators_initialized(&self) -> Result<bool>
pub fn indicators_initialized(&self) -> Result<bool>
Returns whether all registered indicators are initialized.
§Errors
Returns an error if a registered indicator cannot report readiness.
Sourcepub fn register_indicator_for_quote_ticks(
&mut self,
instrument_id: InstrumentId,
indicator: SharedActorIndicator,
)
pub fn register_indicator_for_quote_ticks( &mut self, instrument_id: InstrumentId, indicator: SharedActorIndicator, )
Registers an indicator to receive quote ticks for an instrument.
Sourcepub fn register_indicator_for_trade_ticks(
&mut self,
instrument_id: InstrumentId,
indicator: SharedActorIndicator,
)
pub fn register_indicator_for_trade_ticks( &mut self, instrument_id: InstrumentId, indicator: SharedActorIndicator, )
Registers an indicator to receive trade ticks for an instrument.
Sourcepub fn register_indicator_for_bars(
&mut self,
bar_type: BarType,
indicator: SharedActorIndicator,
)
pub fn register_indicator_for_bars( &mut self, bar_type: BarType, indicator: SharedActorIndicator, )
Registers an indicator to receive bars for a bar type.
Sourcepub fn mem_address(&self) -> String
pub fn mem_address(&self) -> String
Returns the memory address of this instance as a hexadecimal string.
Sourcepub fn state(&self) -> ComponentState
pub fn state(&self) -> ComponentState
Returns the actors state.
Sourcepub fn timestamp_ns(&self) -> UnixNanos
pub fn timestamp_ns(&self) -> UnixNanos
Returns a UNIX nanoseconds timestamp from the actor’s internal clock.
Sourcepub fn register(
&mut self,
trader_id: TraderId,
clock: Rc<RefCell<dyn Clock>>,
cache: Rc<RefCell<Cache>>,
) -> Result<()>
pub fn register( &mut self, trader_id: TraderId, clock: Rc<RefCell<dyn Clock>>, cache: Rc<RefCell<Cache>>, ) -> Result<()>
Register the data actor with a trader.
§Errors
Returns an error if the actor has already been registered with a trader or if the provided dependencies are invalid.
Sourcepub fn register_warning_event(&mut self, event_type: &str)
pub fn register_warning_event(&mut self, event_type: &str)
Register an event type for warning log levels.
Sourcepub fn deregister_warning_event(&mut self, event_type: &str)
pub fn deregister_warning_event(&mut self, event_type: &str)
Deregister an event type from warning log levels.
Sourcepub fn message_bus(&self) -> Rc<PyMessageBusScope>
pub fn message_bus(&self) -> Rc<PyMessageBusScope>
Returns this component’s shared Python message-bus state.
pub fn is_registered(&self) -> bool
Sourcepub fn shutdown_system(&self, reason: Option<String>)
pub fn shutdown_system(&self, reason: Option<String>)
Sends a shutdown command to the system with an optional reason.
§Panics
Panics if the actor is not registered or has no trader ID.
Sourcepub fn publish_data(&self, data_type: &DataType, data: &CustomData)
pub fn publish_data(&self, data_type: &DataType, data: &CustomData)
Publishes data on the message bus under the topic derived from data_type.
data_type is kept as an explicit parameter (rather than deriving it from
data.data_type) to mirror the v1 Python publish_data(data_type, data) API and
to allow callers to override the routing topic from the payload’s intrinsic type.
§Panics
Panics if the actor is not registered with a trader.
Sourcepub fn publish_signal(&self, name: &str, value: String, ts_event: UnixNanos)
pub fn publish_signal(&self, name: &str, value: String, ts_event: UnixNanos)
Publishes a Signal constructed from name and value, wrapped in [CustomData]
so it is consumed by signal subscribers and by any CustomData-aware pipeline
(for example the feather persistence writer).
The topic mirrors the v1 Python scheme data.Signal<TitleName> so subscribers
using either a specific name or the global wildcard are both notified.
If ts_event is zero then the current clock timestamp is used.
§Panics
Panics if the actor is not registered with a trader.
Sourcepub fn add_synthetic(&self, synthetic: SyntheticInstrument) -> Result<()>
pub fn add_synthetic(&self, synthetic: SyntheticInstrument) -> Result<()>
Adds the synthetic instrument to the cache.
§Errors
Returns an error if a synthetic with the same ID already exists, or if the backing cache fails to persist it. Panics if the actor is not registered with a trader. // panics-doc-ok
Sourcepub fn update_synthetic(&self, synthetic: SyntheticInstrument) -> Result<()>
pub fn update_synthetic(&self, synthetic: SyntheticInstrument) -> Result<()>
Updates the synthetic instrument in the cache, replacing the existing entry.
§Errors
Returns an error if no synthetic with the same ID already exists, or if the backing cache fails to persist the replacement. Panics if the actor is not registered with a trader. // panics-doc-ok
Sourcepub fn subscribe_data(
&mut self,
handler: ShareableMessageHandler,
data_type: DataType,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn subscribe_data( &mut self, handler: ShareableMessageHandler, data_type: DataType, client_id: Option<ClientId>, params: Option<Params>, )
Sourcepub fn subscribe_signal(
&mut self,
handler: ShareableMessageHandler,
name: &str,
priority: Option<u32>,
)
pub fn subscribe_signal( &mut self, handler: ShareableMessageHandler, name: &str, priority: Option<u32>, )
Subscribes the actor to signal.
An empty name subscribes to every signal via the data.Signal* wildcard pattern.
§Panics
Panics if the actor is not registered with a trader.
Sourcepub fn subscribe_queue_state(
&mut self,
handler: ShareableMessageHandler,
channel: Option<SystemChannel>,
priority: Option<u32>,
)
pub fn subscribe_queue_state( &mut self, handler: ShareableMessageHandler, channel: Option<SystemChannel>, priority: Option<u32>, )
Registers a queue state change subscription from the trait.
§Panics
Panics if the actor is not registered with a trader.
Sourcepub fn subscribe_socket_state(
&mut self,
handler: ShareableMessageHandler,
client_id: Option<ClientId>,
endpoint: Option<&str>,
priority: Option<u32>,
)
pub fn subscribe_socket_state( &mut self, handler: ShareableMessageHandler, client_id: Option<ClientId>, endpoint: Option<&str>, priority: Option<u32>, )
Registers a socket state change subscription from the trait.
§Panics
Panics if the actor is not registered with a trader.
Sourcepub fn subscribe_quotes(
&mut self,
handler: TypedHandler<QuoteTick>,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_quotes( &mut self, handler: TypedHandler<QuoteTick>, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to quotes.
§Errors
Returns an error if:
- The list is empty.
- The IDs span venues without an explicit client.
- The client is not external and the list mixes client, synthetic, or spread quote routes.
Sourcepub fn subscribe_instruments(
&mut self,
pattern: MStr<Pattern>,
handler: TypedHandler<InstrumentAny>,
venue: Venue,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn subscribe_instruments( &mut self, pattern: MStr<Pattern>, handler: TypedHandler<InstrumentAny>, venue: Venue, client_id: Option<ClientId>, params: Option<Params>, )
Subscribes the actor to instruments.
Sourcepub fn subscribe_instrument(
&mut self,
handler: TypedHandler<InstrumentAny>,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_instrument( &mut self, handler: TypedHandler<InstrumentAny>, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to instrument.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
- The client is not external and the list contains multiple IDs with a synthetic member.
Sourcepub fn subscribe_book_deltas(
&mut self,
handler: TypedHandler<OrderBookDeltas>,
instrument_ids: impl IntoInstrumentIds,
book_type: BookType,
depth: Option<NonZeroUsize>,
client_id: Option<ClientId>,
managed: bool,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_book_deltas( &mut self, handler: TypedHandler<OrderBookDeltas>, instrument_ids: impl IntoInstrumentIds, book_type: BookType, depth: Option<NonZeroUsize>, client_id: Option<ClientId>, managed: bool, params: Option<Params>, ) -> Result<()>
Subscribes the actor to book deltas.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
- The client is not external and the list contains multiple IDs with a synthetic member.
Sourcepub fn subscribe_book_depth(
&mut self,
handler: TypedHandler<OrderBookDepth>,
instrument_ids: impl IntoInstrumentIds,
book_type: BookType,
depth: Option<NonZeroUsize>,
client_id: Option<ClientId>,
managed: bool,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_book_depth( &mut self, handler: TypedHandler<OrderBookDepth>, instrument_ids: impl IntoInstrumentIds, book_type: BookType, depth: Option<NonZeroUsize>, client_id: Option<ClientId>, managed: bool, params: Option<Params>, ) -> Result<()>
Subscribes the actor to book depth.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
- The client is not external and the list contains multiple IDs with a synthetic member.
Sourcepub fn subscribe_book_at_interval(
&mut self,
handler: TypedHandler<OrderBook>,
instrument_ids: impl IntoInstrumentIds,
book_type: BookType,
depth: Option<NonZeroUsize>,
interval_ms: NonZeroUsize,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_book_at_interval( &mut self, handler: TypedHandler<OrderBook>, instrument_ids: impl IntoInstrumentIds, book_type: BookType, depth: Option<NonZeroUsize>, interval_ms: NonZeroUsize, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to book snapshots.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
- The client is not external and the list contains multiple IDs with a synthetic member.
Sourcepub fn subscribe_trades(
&mut self,
handler: TypedHandler<TradeTick>,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_trades( &mut self, handler: TypedHandler<TradeTick>, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to trades.
§Errors
Returns an error if:
- The list is empty.
- The IDs span venues without an explicit client.
Sourcepub fn subscribe_bars(
&mut self,
handler: TypedHandler<Bar>,
bar_types: impl IntoBarTypes,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_bars( &mut self, handler: TypedHandler<Bar>, bar_types: impl IntoBarTypes, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to bars for one or more full bar types.
§Errors
Returns an error if the list is empty or spans venues without an explicit client.
Sourcepub fn subscribe_mark_prices(
&mut self,
handler: TypedHandler<MarkPriceUpdate>,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_mark_prices( &mut self, handler: TypedHandler<MarkPriceUpdate>, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to mark prices.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn subscribe_index_prices(
&mut self,
handler: TypedHandler<IndexPriceUpdate>,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_index_prices( &mut self, handler: TypedHandler<IndexPriceUpdate>, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to index prices.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn subscribe_funding_rates(
&mut self,
handler: TypedHandler<FundingRateUpdate>,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_funding_rates( &mut self, handler: TypedHandler<FundingRateUpdate>, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to funding rates.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn subscribe_option_greeks(
&mut self,
handler: TypedHandler<OptionGreeks>,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_option_greeks( &mut self, handler: TypedHandler<OptionGreeks>, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to option greeks.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
- The client is not external and the list contains multiple IDs with a synthetic member.
Sourcepub fn subscribe_instrument_status(
&mut self,
handler: ShareableMessageHandler,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_instrument_status( &mut self, handler: ShareableMessageHandler, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to instrument status.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
- The client is not external and the list contains multiple IDs with a synthetic member.
Sourcepub fn subscribe_instrument_close(
&mut self,
handler: ShareableMessageHandler,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn subscribe_instrument_close( &mut self, handler: ShareableMessageHandler, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Subscribes the actor to instrument close.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
- The client is not external and the list contains multiple IDs with a synthetic member.
Sourcepub fn subscribe_option_chain(
&mut self,
topic: MStr<Topic>,
handler: TypedHandler<OptionChainSlice>,
series_id: OptionSeriesId,
strike_range: StrikeRange,
snapshot_interval_ms: Option<u64>,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn subscribe_option_chain( &mut self, topic: MStr<Topic>, handler: TypedHandler<OptionChainSlice>, series_id: OptionSeriesId, strike_range: StrikeRange, snapshot_interval_ms: Option<u64>, client_id: Option<ClientId>, params: Option<Params>, )
Subscribes the actor to option chain snapshots.
Sourcepub fn unsubscribe_data(
&mut self,
data_type: DataType,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn unsubscribe_data( &mut self, data_type: DataType, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribes the actor from data.
Sourcepub fn unsubscribe_signal(&mut self, name: &str)
pub fn unsubscribe_signal(&mut self, name: &str)
Sourcepub fn unsubscribe_queue_state(&mut self, channel: Option<SystemChannel>)
pub fn unsubscribe_queue_state(&mut self, channel: Option<SystemChannel>)
Sourcepub fn unsubscribe_socket_state(
&mut self,
client_id: Option<ClientId>,
endpoint: Option<&str>,
)
pub fn unsubscribe_socket_state( &mut self, client_id: Option<ClientId>, endpoint: Option<&str>, )
Unsubscribes from socket state changes.
§Panics
Panics if the actor is not registered with a trader.
Sourcepub fn unsubscribe_instruments(
&mut self,
venue: Venue,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn unsubscribe_instruments( &mut self, venue: Venue, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribes the actor from instruments.
Sourcepub fn unsubscribe_instrument(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_instrument( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from instrument.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_book_deltas(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_book_deltas( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from book deltas.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_book_depth(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_book_depth( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from book depth snapshots.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_book_at_interval(
&mut self,
instrument_ids: impl IntoInstrumentIds,
interval_ms: NonZeroUsize,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_book_at_interval( &mut self, instrument_ids: impl IntoInstrumentIds, interval_ms: NonZeroUsize, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from book snapshots at interval.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_quotes(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_quotes( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from quotes.
Groups releases by acquisition and assigns a unique ID to each emitted command.
§Errors
Returns an error if:
- The list is empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_trades(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_trades( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from trades using each instrument’s retained route.
§Errors
Returns an error if:
- The list is empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_bars(
&mut self,
bar_types: impl IntoBarTypes,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_bars( &mut self, bar_types: impl IntoBarTypes, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from bars using each type’s retained route.
§Errors
Returns an error if the list is empty or spans venues without an explicit client.
Sourcepub fn unsubscribe_mark_prices(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_mark_prices( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from mark prices.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_index_prices(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_index_prices( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from index prices.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_funding_rates(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_funding_rates( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from funding rates.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_option_greeks(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_option_greeks( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from option greeks.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_instrument_status(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_instrument_status( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from instrument status.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_instrument_close(
&mut self,
instrument_ids: impl IntoInstrumentIds,
client_id: Option<ClientId>,
_params: Option<Params>,
) -> Result<()>
pub fn unsubscribe_instrument_close( &mut self, instrument_ids: impl IntoInstrumentIds, client_id: Option<ClientId>, _params: Option<Params>, ) -> Result<()>
Unsubscribes the actor from instrument close.
§Errors
Returns an error if:
- The IDs are empty.
- The IDs span venues without an explicit client.
Sourcepub fn unsubscribe_option_chain(
&mut self,
series_id: OptionSeriesId,
client_id: Option<ClientId>,
)
pub fn unsubscribe_option_chain( &mut self, series_id: OptionSeriesId, client_id: Option<ClientId>, )
Unsubscribes the actor from option chain snapshots.
Sourcepub fn request_data(
&self,
data_type: DataType,
client_id: ClientId,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZeroUsize>,
params: Option<Params>,
handler: TypedHandler<DataResponseEnvelope>,
) -> Result<UUID4>
pub fn request_data( &self, data_type: DataType, client_id: ClientId, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZeroUsize>, params: Option<Params>, handler: TypedHandler<DataResponseEnvelope>, ) -> Result<UUID4>
Sourcepub fn request_instrument(
&self,
instrument_ids: impl IntoInstrumentIds,
start: Option<Timestamp>,
end: Option<Timestamp>,
client_id: Option<ClientId>,
params: Option<Params>,
handler: TypedHandler<DataResponseEnvelope>,
) -> Result<UUID4>
pub fn request_instrument( &self, instrument_ids: impl IntoInstrumentIds, start: Option<Timestamp>, end: Option<Timestamp>, client_id: Option<ClientId>, params: Option<Params>, handler: TypedHandler<DataResponseEnvelope>, ) -> Result<UUID4>
Sourcepub fn request_instruments(
&self,
venue: Option<Venue>,
start: Option<Timestamp>,
end: Option<Timestamp>,
client_id: Option<ClientId>,
params: Option<Params>,
handler: TypedHandler<DataResponseEnvelope>,
) -> Result<UUID4>
pub fn request_instruments( &self, venue: Option<Venue>, start: Option<Timestamp>, end: Option<Timestamp>, client_id: Option<ClientId>, params: Option<Params>, handler: TypedHandler<DataResponseEnvelope>, ) -> Result<UUID4>
Sourcepub fn request_book_snapshot(
&self,
instrument_ids: impl IntoInstrumentIds,
depth: Option<NonZeroUsize>,
client_id: Option<ClientId>,
params: Option<Params>,
handler: TypedHandler<DataResponseEnvelope>,
) -> Result<UUID4>
pub fn request_book_snapshot( &self, instrument_ids: impl IntoInstrumentIds, depth: Option<NonZeroUsize>, client_id: Option<ClientId>, params: Option<Params>, handler: TypedHandler<DataResponseEnvelope>, ) -> Result<UUID4>
Sourcepub fn request_book_deltas(
&self,
instrument_ids: impl IntoInstrumentIds,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZeroUsize>,
client_id: Option<ClientId>,
params: Option<Params>,
handler: TypedHandler<DataResponseEnvelope>,
) -> Result<UUID4>
pub fn request_book_deltas( &self, instrument_ids: impl IntoInstrumentIds, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZeroUsize>, client_id: Option<ClientId>, params: Option<Params>, handler: TypedHandler<DataResponseEnvelope>, ) -> Result<UUID4>
Sourcepub fn request_book_depth(
&self,
instrument_ids: impl IntoInstrumentIds,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZeroUsize>,
depth: Option<NonZeroUsize>,
client_id: Option<ClientId>,
params: Option<Params>,
handler: TypedHandler<DataResponseEnvelope>,
) -> Result<UUID4>
pub fn request_book_depth( &self, instrument_ids: impl IntoInstrumentIds, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZeroUsize>, depth: Option<NonZeroUsize>, client_id: Option<ClientId>, params: Option<Params>, handler: TypedHandler<DataResponseEnvelope>, ) -> Result<UUID4>
Sends a request for historical book depth.
§Errors
Returns an error if input parameters are invalid.
Sourcepub fn request_quotes(
&self,
instrument_ids: impl IntoInstrumentIds,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZeroUsize>,
client_id: Option<ClientId>,
params: Option<Params>,
handler: TypedHandler<DataResponseEnvelope>,
) -> Result<UUID4>
pub fn request_quotes( &self, instrument_ids: impl IntoInstrumentIds, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZeroUsize>, client_id: Option<ClientId>, params: Option<Params>, handler: TypedHandler<DataResponseEnvelope>, ) -> Result<UUID4>
Sourcepub fn request_trades(
&self,
instrument_ids: impl IntoInstrumentIds,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZeroUsize>,
client_id: Option<ClientId>,
params: Option<Params>,
handler: TypedHandler<DataResponseEnvelope>,
) -> Result<UUID4>
pub fn request_trades( &self, instrument_ids: impl IntoInstrumentIds, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZeroUsize>, client_id: Option<ClientId>, params: Option<Params>, handler: TypedHandler<DataResponseEnvelope>, ) -> Result<UUID4>
Sourcepub fn request_bars(
&self,
bar_types: impl IntoBarTypes,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZeroUsize>,
client_id: Option<ClientId>,
params: Option<Params>,
handler: TypedHandler<DataResponseEnvelope>,
) -> Result<UUID4>
pub fn request_bars( &self, bar_types: impl IntoBarTypes, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZeroUsize>, client_id: Option<ClientId>, params: Option<Params>, handler: TypedHandler<DataResponseEnvelope>, ) -> Result<UUID4>
Sourcepub fn request_funding_rates(
&self,
instrument_ids: impl IntoInstrumentIds,
start: Option<Timestamp>,
end: Option<Timestamp>,
limit: Option<NonZeroUsize>,
client_id: Option<ClientId>,
params: Option<Params>,
handler: TypedHandler<DataResponseEnvelope>,
) -> Result<UUID4>
pub fn request_funding_rates( &self, instrument_ids: impl IntoInstrumentIds, start: Option<Timestamp>, end: Option<Timestamp>, limit: Option<NonZeroUsize>, client_id: Option<ClientId>, params: Option<Params>, handler: TypedHandler<DataResponseEnvelope>, ) -> Result<UUID4>
Sourcepub fn is_pending_request(&self, request_id: &UUID4) -> bool
pub fn is_pending_request(&self, request_id: &UUID4) -> bool
Returns whether this actor is awaiting completion of a request.
Sourcepub fn pending_requests(&self) -> Vec<UUID4>
pub fn pending_requests(&self) -> Vec<UUID4>
Returns the IDs of this actor’s pending historical requests and groups in unspecified order.
Source§impl DataActorCore
impl DataActorCore
Sourcepub fn subscribe_blocks(
&mut self,
topic: MStr<Topic>,
handler: TypedHandler<Block>,
chain: Blockchain,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn subscribe_blocks( &mut self, topic: MStr<Topic>, handler: TypedHandler<Block>, chain: Blockchain, client_id: Option<ClientId>, params: Option<Params>, )
Subscribes the actor to block.
Sourcepub fn subscribe_pool(
&mut self,
topic: MStr<Topic>,
handler: TypedHandler<Pool>,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn subscribe_pool( &mut self, topic: MStr<Topic>, handler: TypedHandler<Pool>, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribes the actor to pool.
Sourcepub fn subscribe_pool_swaps(
&mut self,
topic: MStr<Topic>,
handler: TypedHandler<PoolSwap>,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn subscribe_pool_swaps( &mut self, topic: MStr<Topic>, handler: TypedHandler<PoolSwap>, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribes the actor to pool swap.
Sourcepub fn subscribe_pool_liquidity_updates(
&mut self,
topic: MStr<Topic>,
handler: TypedHandler<PoolLiquidityUpdate>,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn subscribe_pool_liquidity_updates( &mut self, topic: MStr<Topic>, handler: TypedHandler<PoolLiquidityUpdate>, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribes the actor to pool liquidity update.
Sourcepub fn subscribe_pool_fee_collects(
&mut self,
topic: MStr<Topic>,
handler: TypedHandler<PoolFeeCollect>,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn subscribe_pool_fee_collects( &mut self, topic: MStr<Topic>, handler: TypedHandler<PoolFeeCollect>, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribes the actor to pool fee collect.
Sourcepub fn subscribe_pool_flash_events(
&mut self,
topic: MStr<Topic>,
handler: TypedHandler<PoolFlash>,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn subscribe_pool_flash_events( &mut self, topic: MStr<Topic>, handler: TypedHandler<PoolFlash>, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Subscribes the actor to pool flash event.
Sourcepub fn unsubscribe_blocks(
&mut self,
chain: Blockchain,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn unsubscribe_blocks( &mut self, chain: Blockchain, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribes the actor from blocks.
Sourcepub fn unsubscribe_pool(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn unsubscribe_pool( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribes the actor from pool definition updates.
Sourcepub fn unsubscribe_pool_swaps(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn unsubscribe_pool_swaps( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribes the actor from pool swaps.
Sourcepub fn unsubscribe_pool_liquidity_updates(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn unsubscribe_pool_liquidity_updates( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribes the actor from pool liquidity updates.
Sourcepub fn unsubscribe_pool_fee_collects(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn unsubscribe_pool_fee_collects( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribes the actor from pool fee collects.
Sourcepub fn unsubscribe_pool_flash_events(
&mut self,
instrument_id: InstrumentId,
client_id: Option<ClientId>,
params: Option<Params>,
)
pub fn unsubscribe_pool_flash_events( &mut self, instrument_id: InstrumentId, client_id: Option<ClientId>, params: Option<Params>, )
Unsubscribes the actor from pool flash events.