#[repr(C)]pub struct NodeAppVTable {
pub metadata: NodeAppMetadata,
pub init: unsafe extern "C" fn(ctx: *const c_void) -> FfiResult,
pub shutdown: unsafe extern "C" fn() -> FfiResult,
pub handle_request: unsafe extern "C" fn(request_json: *const u8, request_len: usize) -> FfiResult,
pub handle_event: unsafe extern "C" fn(event_json: *const u8, event_len: usize) -> FfiResult,
pub handle_capability: unsafe extern "C" fn(request_json: *const u8, request_len: usize) -> FfiResult,
pub free: unsafe extern "C" fn(ptr: *mut u8, len: usize),
}Expand description
VTable of function pointers for app operations.
Returned by the _node_app_entry symbol.
Fields§
§metadata: NodeAppMetadataApp metadata
init: unsafe extern "C" fn(ctx: *const c_void) -> FfiResultInitialize the app with the host context. Called once after loading. Returns FfiResult.
shutdown: unsafe extern "C" fn() -> FfiResultShut down the app gracefully. Called before unloading the shared library.
handle_request: unsafe extern "C" fn(request_json: *const u8, request_len: usize) -> FfiResultHandle an HTTP request.
request_json is a pointer to UTF-8 JSON bytes of length request_len.
Returns FfiResult with response JSON in data/data_len.
handle_event: unsafe extern "C" fn(event_json: *const u8, event_len: usize) -> FfiResultHandle a domain event.
event_json is a pointer to UTF-8 JSON bytes of length event_len.
Returns FfiResult (data is typically empty for events).
handle_capability: unsafe extern "C" fn(request_json: *const u8, request_len: usize) -> FfiResultHandle a capability invocation from the capability router.
request_json is a pointer to UTF-8 JSON bytes (CapabilityRequest) of length request_len.
Returns FfiResult with CapabilityResponse JSON in data/data_len.
Response is limited to 16MB.
free: unsafe extern "C" fn(ptr: *mut u8, len: usize)Free memory allocated by the app (for response data).
The host calls this to release FfiResult.data.