Skip to main content

PluginActor

Trait PluginActor 

Source
pub trait PluginActor:
    'static
    + Send
    + Sized {
    const TYPE_NAME: &'static str;
Show 34 methods // Required method fn new( host: *const HostVTable, ctx: *const HostContext, config_json: &str, ) -> Self; // Provided methods fn on_start(&mut self) -> Result<()> { ... } fn on_stop(&mut self) -> Result<()> { ... } fn on_resume(&mut self) -> Result<()> { ... } fn on_reset(&mut self) -> Result<()> { ... } fn on_dispose(&mut self) -> Result<()> { ... } fn on_degrade(&mut self) -> Result<()> { ... } fn on_fault(&mut self) -> Result<()> { ... } fn on_time_event(&mut self, event: &TimeEvent) -> Result<()> { ... } fn on_data(&mut self, data: PluginCustomDataRef) -> Result<()> { ... } fn on_instrument(&mut self, instrument: &InstrumentAny) -> Result<()> { ... } fn on_book_deltas(&mut self, deltas: &OrderBookDeltas) -> Result<()> { ... } fn on_book(&mut self, book: &OrderBook) -> Result<()> { ... } fn on_quote(&mut self, quote: &QuoteTick) -> Result<()> { ... } fn on_trade(&mut self, trade: &TradeTick) -> Result<()> { ... } fn on_bar(&mut self, bar: &Bar) -> Result<()> { ... } fn on_mark_price(&mut self, mark_price: &MarkPriceUpdate) -> Result<()> { ... } fn on_index_price(&mut self, index_price: &IndexPriceUpdate) -> Result<()> { ... } fn on_funding_rate( &mut self, funding_rate: &FundingRateUpdate, ) -> Result<()> { ... } fn on_option_greeks(&mut self, greeks: &OptionGreeks) -> Result<()> { ... } fn on_option_chain(&mut self, chain: &OptionChainSlice) -> Result<()> { ... } fn on_instrument_status(&mut self, status: &InstrumentStatus) -> Result<()> { ... } fn on_instrument_close(&mut self, close: &InstrumentClose) -> Result<()> { ... } fn on_order_filled(&mut self, event: &OrderFilled) -> Result<()> { ... } fn on_order_canceled(&mut self, event: &OrderCanceled) -> Result<()> { ... } fn on_signal(&mut self, signal: &Signal) -> Result<()> { ... } fn on_historical_book_deltas( &mut self, deltas: &[OrderBookDelta], ) -> Result<()> { ... } fn on_historical_book_depth( &mut self, depths: &[OrderBookDepth10], ) -> Result<()> { ... } fn on_historical_quotes(&mut self, quotes: &[QuoteTick]) -> Result<()> { ... } fn on_historical_trades(&mut self, trades: &[TradeTick]) -> Result<()> { ... } fn on_historical_bars(&mut self, bars: &[Bar]) -> Result<()> { ... } fn on_historical_mark_prices( &mut self, mark_prices: &[MarkPriceUpdate], ) -> Result<()> { ... } fn on_historical_index_prices( &mut self, index_prices: &[IndexPriceUpdate], ) -> Result<()> { ... } fn on_historical_funding_rates( &mut self, funding_rates: &[FundingRateUpdate], ) -> Result<()> { ... }
}
Expand description

Author-facing trait for a plug-in actor.

Every callback has a no-op default; authors override the ones they care about. Callbacks receive borrowed references to host-owned values; the references are only valid for the duration of the call.

Required Associated Constants§

Source

const TYPE_NAME: &'static str

Canonical type name. Must be unique across a Nautilus deployment.

Required Methods§

Source

fn new( host: *const HostVTable, ctx: *const HostContext, config_json: &str, ) -> Self

Constructs a fresh actor instance bound to the supplied host vtable and instance context.

config_json is the per-instance JSON configuration the host constructed from the user’s TOML or builder API. The string is empty when no instance-specific configuration is supplied.

Provided Methods§

Source

fn on_start(&mut self) -> Result<()>

Source

fn on_stop(&mut self) -> Result<()>

Source

fn on_resume(&mut self) -> Result<()>

Source

fn on_reset(&mut self) -> Result<()>

Source

fn on_dispose(&mut self) -> Result<()>

Source

fn on_degrade(&mut self) -> Result<()>

Source

fn on_fault(&mut self) -> Result<()>

Source

fn on_time_event(&mut self, event: &TimeEvent) -> Result<()>

Source

fn on_data(&mut self, data: PluginCustomDataRef) -> Result<()>

Source

fn on_instrument(&mut self, instrument: &InstrumentAny) -> Result<()>

Source

fn on_book_deltas(&mut self, deltas: &OrderBookDeltas) -> Result<()>

Source

fn on_book(&mut self, book: &OrderBook) -> Result<()>

Source

fn on_quote(&mut self, quote: &QuoteTick) -> Result<()>

Source

fn on_trade(&mut self, trade: &TradeTick) -> Result<()>

Source

fn on_bar(&mut self, bar: &Bar) -> Result<()>

Source

fn on_mark_price(&mut self, mark_price: &MarkPriceUpdate) -> Result<()>

Source

fn on_index_price(&mut self, index_price: &IndexPriceUpdate) -> Result<()>

Source

fn on_funding_rate(&mut self, funding_rate: &FundingRateUpdate) -> Result<()>

Source

fn on_option_greeks(&mut self, greeks: &OptionGreeks) -> Result<()>

Source

fn on_option_chain(&mut self, chain: &OptionChainSlice) -> Result<()>

Source

fn on_instrument_status(&mut self, status: &InstrumentStatus) -> Result<()>

Source

fn on_instrument_close(&mut self, close: &InstrumentClose) -> Result<()>

Source

fn on_order_filled(&mut self, event: &OrderFilled) -> Result<()>

Source

fn on_order_canceled(&mut self, event: &OrderCanceled) -> Result<()>

Source

fn on_signal(&mut self, signal: &Signal) -> Result<()>

Source

fn on_historical_book_deltas(&mut self, deltas: &[OrderBookDelta]) -> Result<()>

Source

fn on_historical_book_depth( &mut self, depths: &[OrderBookDepth10], ) -> Result<()>

Source

fn on_historical_quotes(&mut self, quotes: &[QuoteTick]) -> Result<()>

Source

fn on_historical_trades(&mut self, trades: &[TradeTick]) -> Result<()>

Source

fn on_historical_bars(&mut self, bars: &[Bar]) -> Result<()>

Source

fn on_historical_mark_prices( &mut self, mark_prices: &[MarkPriceUpdate], ) -> Result<()>

Source

fn on_historical_index_prices( &mut self, index_prices: &[IndexPriceUpdate], ) -> Result<()>

Source

fn on_historical_funding_rates( &mut self, funding_rates: &[FundingRateUpdate], ) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§