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§
Required Methods§
Sourcefn new(
host: *const HostVTable,
ctx: *const HostContext,
config_json: &str,
) -> Self
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§
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<()>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".