#[repr(C)]pub struct ControllerHostVTable {
pub abi_version: u32,
pub create_plugin_strategy: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>,
pub start_strategy: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>,
pub stop_strategy: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>,
pub exit_market: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>,
pub remove_strategy: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>,
pub instrument_exists: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>,
pub log: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>,
pub clock_now_ns: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>,
}Expand description
Function table the host passes to every controller plug-in instance.
Each service accepts a JSON request envelope and returns a JSON response
envelope as OwnedBytes. The producing side owns and frees returned
allocations so host and plug-in allocators remain isolated.
Fields§
§abi_version: u32ABI version of this vtable. Must equal NAUTILUS_PLUGIN_ABI_VERSION.
create_plugin_strategy: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>Creates a plug-in strategy through the host’s registered controller.
start_strategy: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>Starts a strategy through the host’s system controller command path.
stop_strategy: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>Stops a strategy through the host’s system controller command path.
exit_market: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>Exits the market for a strategy through the system controller.
remove_strategy: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>Removes a strategy through the system controller.
instrument_exists: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>Checks whether an instrument is present in the host cache.
log: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>Emits a structured log record through the host logger.
clock_now_ns: unsafe extern "C" fn(ctx: *const ControllerHostContext, request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>Returns the host clock reading in a JSON response envelope.
Implementations§
Source§impl ControllerHostVTable
impl ControllerHostVTable
Sourcepub fn matches_compiled_abi(&self) -> bool
pub fn matches_compiled_abi(&self) -> bool
Asserts that the embedded ABI version matches the compiled-in constant.
Trait Implementations§
impl Send for ControllerHostVTable
SAFETY: function pointers are thread-safe by construction; the host
guarantees the underlying implementations are Sync.
impl Sync for ControllerHostVTable
SAFETY: see above.