#[repr(C)]pub struct ActorVTable {Show 36 fields
pub create: Option<unsafe extern "C" fn(host: *const HostVTable, ctx: *const HostContext, config_json: BorrowedStr<'_>) -> *mut PluginActorHandle>,
pub drop_handle: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle)>,
pub type_name: Option<unsafe extern "C" fn() -> BorrowedStr<'static>>,
pub on_start: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>,
pub on_stop: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>,
pub on_resume: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>,
pub on_reset: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>,
pub on_dispose: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>,
pub on_degrade: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>,
pub on_fault: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>,
pub on_time_event: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, event: *const TimeEvent) -> PluginResult<()>>,
pub on_data: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, data: PluginCustomDataRef) -> PluginResult<()>>,
pub on_instrument: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, instrument: *const InstrumentAnyHandle) -> PluginResult<()>>,
pub on_book_deltas: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, deltas: *const OrderBookDeltasHandle) -> PluginResult<()>>,
pub on_book: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, book: *const OrderBookHandle) -> PluginResult<()>>,
pub on_quote: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, quote: *const QuoteTick) -> PluginResult<()>>,
pub on_trade: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, trade: *const TradeTick) -> PluginResult<()>>,
pub on_bar: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, bar: *const Bar) -> PluginResult<()>>,
pub on_mark_price: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, mark_price: *const MarkPriceUpdate) -> PluginResult<()>>,
pub on_index_price: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, index_price: *const IndexPriceUpdate) -> PluginResult<()>>,
pub on_funding_rate: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, funding_rate: *const FundingRateUpdate) -> PluginResult<()>>,
pub on_option_greeks: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, greeks: *const OptionGreeks) -> PluginResult<()>>,
pub on_option_chain: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, chain: *const OptionChainSliceHandle) -> PluginResult<()>>,
pub on_instrument_status: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, status: *const InstrumentStatus) -> PluginResult<()>>,
pub on_instrument_close: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, close: *const InstrumentClose) -> PluginResult<()>>,
pub on_order_filled: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, event: *const OrderFilled) -> PluginResult<()>>,
pub on_order_canceled: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, event: *const OrderCanceled) -> PluginResult<()>>,
pub on_signal: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, signal: *const Signal) -> PluginResult<()>>,
pub on_historical_book_deltas: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, deltas: Slice<'_, OrderBookDelta>) -> PluginResult<()>>,
pub on_historical_book_depth: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, depths: Slice<'_, OrderBookDepth10>) -> PluginResult<()>>,
pub on_historical_quotes: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, quotes: Slice<'_, QuoteTick>) -> PluginResult<()>>,
pub on_historical_trades: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, trades: Slice<'_, TradeTick>) -> PluginResult<()>>,
pub on_historical_bars: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, bars: Slice<'_, Bar>) -> PluginResult<()>>,
pub on_historical_mark_prices: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, mark_prices: Slice<'_, MarkPriceUpdate>) -> PluginResult<()>>,
pub on_historical_index_prices: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, index_prices: Slice<'_, IndexPriceUpdate>) -> PluginResult<()>>,
pub on_historical_funding_rates: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, funding_rates: Slice<'_, FundingRateUpdate>) -> PluginResult<()>>,
}Expand description
Function table for a single plug-in actor type.
One static vtable per concrete type, generated by
nautilus_plugin! via the Tag<T> pattern that
also powers custom_data_vtable.
Every callback that returns PluginResult<()> runs inside
crate::panic::guard. The infallible create/drop callbacks run
inside crate::panic::guard_infallible, which aborts the host on
panic since their signatures cannot carry an error.
Slots are nullable at the ABI type level so the host can reject malformed manifests with null callbacks before constructing an actor. Macro-generated vtables fill every required slot.
Fields§
§create: Option<unsafe extern "C" fn(host: *const HostVTable, ctx: *const HostContext, config_json: BorrowedStr<'_>) -> *mut PluginActorHandle>Constructs a fresh actor instance bound to the supplied host vtable and instance context, and returns a non-null handle.
config_json carries the per-instance configuration the host
constructed from the user’s TOML or builder API. Empty when the
host has no instance-specific configuration to pass.
drop_handle: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle)>Drops the actor instance and releases all of its resources.
type_name: Option<unsafe extern "C" fn() -> BorrowedStr<'static>>Returns the canonical type name for this actor.
on_start: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>§on_stop: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>§on_resume: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>§on_reset: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>§on_dispose: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>§on_degrade: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>§on_fault: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle) -> PluginResult<()>>§on_time_event: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, event: *const TimeEvent) -> PluginResult<()>>§on_data: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, data: PluginCustomDataRef) -> PluginResult<()>>§on_instrument: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, instrument: *const InstrumentAnyHandle) -> PluginResult<()>>§on_book_deltas: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, deltas: *const OrderBookDeltasHandle) -> PluginResult<()>>§on_book: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, book: *const OrderBookHandle) -> PluginResult<()>>§on_quote: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, quote: *const QuoteTick) -> PluginResult<()>>§on_trade: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, trade: *const TradeTick) -> PluginResult<()>>§on_bar: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, bar: *const Bar) -> PluginResult<()>>§on_mark_price: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, mark_price: *const MarkPriceUpdate) -> PluginResult<()>>§on_index_price: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, index_price: *const IndexPriceUpdate) -> PluginResult<()>>§on_funding_rate: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, funding_rate: *const FundingRateUpdate) -> PluginResult<()>>§on_option_greeks: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, greeks: *const OptionGreeks) -> PluginResult<()>>§on_option_chain: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, chain: *const OptionChainSliceHandle) -> PluginResult<()>>§on_instrument_status: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, status: *const InstrumentStatus) -> PluginResult<()>>§on_instrument_close: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, close: *const InstrumentClose) -> PluginResult<()>>§on_order_filled: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, event: *const OrderFilled) -> PluginResult<()>>§on_order_canceled: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, event: *const OrderCanceled) -> PluginResult<()>>§on_signal: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, signal: *const Signal) -> PluginResult<()>>§on_historical_book_deltas: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, deltas: Slice<'_, OrderBookDelta>) -> PluginResult<()>>§on_historical_book_depth: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, depths: Slice<'_, OrderBookDepth10>) -> PluginResult<()>>§on_historical_quotes: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, quotes: Slice<'_, QuoteTick>) -> PluginResult<()>>§on_historical_trades: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, trades: Slice<'_, TradeTick>) -> PluginResult<()>>§on_historical_bars: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, bars: Slice<'_, Bar>) -> PluginResult<()>>§on_historical_mark_prices: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, mark_prices: Slice<'_, MarkPriceUpdate>) -> PluginResult<()>>§on_historical_index_prices: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, index_prices: Slice<'_, IndexPriceUpdate>) -> PluginResult<()>>§on_historical_funding_rates: Option<unsafe extern "C" fn(handle: *mut PluginActorHandle, funding_rates: Slice<'_, FundingRateUpdate>) -> PluginResult<()>>