Skip to main content

CustomDataVTable

Struct CustomDataVTable 

Source
#[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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.