#[repr(C)]pub struct CustomDataVTable {
pub type_name: Option<unsafe extern "C" fn() -> BorrowedStr<'static>>,
pub schema_ipc: Option<unsafe extern "C" fn() -> PluginResult<OwnedBytes>>,
pub from_json: Option<unsafe extern "C" fn(payload: BorrowedStr<'_>) -> PluginResult<*mut CustomDataHandle>>,
pub encode_batch: Option<unsafe extern "C" fn(handles: Slice<'_, *const CustomDataHandle>) -> PluginResult<OwnedBytes>>,
pub decode_batch: Option<unsafe extern "C" fn(ipc_bytes: Slice<'_, u8>, metadata: Slice<'_, MetadataEntry<'_>>) -> PluginResult<OwnedBytes>>,
pub ts_event: Option<unsafe extern "C" fn(handle: *const CustomDataHandle) -> u64>,
pub ts_init: Option<unsafe extern "C" fn(handle: *const CustomDataHandle) -> u64>,
pub to_json: Option<unsafe extern "C" fn(handle: *const CustomDataHandle) -> PluginResult<OwnedBytes>>,
pub clone_handle: Option<unsafe extern "C" fn(handle: *const CustomDataHandle) -> *mut CustomDataHandle>,
pub drop_handle: Option<unsafe extern "C" fn(handle: *mut CustomDataHandle)>,
pub eq_handles: Option<unsafe extern "C" fn(lhs: *const CustomDataHandle, rhs: *const CustomDataHandle) -> bool>,
}Expand description
Function table for a single custom-data type.
One static vtable per concrete type, generated by the nautilus_plugin!
macro and pointed to from the corresponding
crate::manifest::CustomDataRegistration entry.
Slots are nullable at the ABI type level so the host can reject malformed manifests with null callbacks before registering or invoking the vtable. Macro-generated vtables fill every required slot.
Fields§
§type_name: Option<unsafe extern "C" fn() -> BorrowedStr<'static>>Returns the canonical type name (e.g. "MyTickType"). Used for
routing, persistence path layout, and JSON envelope tagging.
schema_ipc: Option<unsafe extern "C" fn() -> PluginResult<OwnedBytes>>Returns the Arrow schema for this type as an Arrow IPC byte stream.
Plug-ins serialize their arrow::datatypes::Schema via
arrow::ipc::writer::StreamWriter so host and plug-in stay agnostic
of each other’s Arrow crate version.
from_json: Option<unsafe extern "C" fn(payload: BorrowedStr<'_>) -> PluginResult<*mut CustomDataHandle>>Decodes a single value from its JSON payload (no envelope) into a new
handle. The handle is owned by the host until passed to drop.
encode_batch: Option<unsafe extern "C" fn(handles: Slice<'_, *const CustomDataHandle>) -> PluginResult<OwnedBytes>>Encodes a batch of handles into an Arrow IPC byte stream.
decode_batch: Option<unsafe extern "C" fn(ipc_bytes: Slice<'_, u8>, metadata: Slice<'_, MetadataEntry<'_>>) -> PluginResult<OwnedBytes>>Decodes an Arrow IPC byte stream into a freshly allocated array of
owned handles, packed as *mut CustomDataHandle elements inside the
returned OwnedBytes. The host must pass every handle through
drop_handle to release its inner value, then drop the OwnedBytes
(or invoke its embedded drop_fn directly) so the array storage is
freed with the original allocator layout. Do not call
crate::boundary::drop_owned_bytes directly: the underlying
allocation is a Vec<*mut CustomDataHandle>, not a Vec<u8>, and the
vtable installs a matching drop_fn on the returned OwnedBytes.
ts_event: Option<unsafe extern "C" fn(handle: *const CustomDataHandle) -> u64>Returns the event timestamp of the value behind the handle.
ts_init: Option<unsafe extern "C" fn(handle: *const CustomDataHandle) -> u64>Returns the init timestamp of the value behind the handle.
to_json: Option<unsafe extern "C" fn(handle: *const CustomDataHandle) -> PluginResult<OwnedBytes>>Serializes a single value to a JSON payload (no envelope).
clone_handle: Option<unsafe extern "C" fn(handle: *const CustomDataHandle) -> *mut CustomDataHandle>Clones the value behind the handle into a new owned handle.
drop_handle: Option<unsafe extern "C" fn(handle: *mut CustomDataHandle)>Drops the value behind the handle, freeing all of its resources.
eq_handles: Option<unsafe extern "C" fn(lhs: *const CustomDataHandle, rhs: *const CustomDataHandle) -> bool>Tests two handles of the same type for value equality.