Skip to main content

NemoRelayNativeHostApiV1

Struct NemoRelayNativeHostApiV1 

Source
#[repr(C)]
pub struct NemoRelayNativeHostApiV1 {
Show 34 fields pub abi_version: u32, pub struct_size: usize, pub relay_version: *const c_char, pub string_new: unsafe extern "C" fn(data: *const u8, len: usize, out: *mut *mut NemoRelayNativeString) -> NemoRelayStatus, pub string_data: unsafe extern "C" fn(value: *const NemoRelayNativeString) -> *const u8, pub string_len: unsafe extern "C" fn(value: *const NemoRelayNativeString) -> usize, pub string_free: unsafe extern "C" fn(value: *mut NemoRelayNativeString), pub last_error_clear: unsafe extern "C" fn(), pub last_error_set: unsafe extern "C" fn(message: *const NemoRelayNativeString), pub plugin_context_register_subscriber: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, cb: NemoRelayNativeEventSubscriberCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_tool_sanitize_request_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeToolJsonCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_tool_sanitize_response_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeToolJsonCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_tool_conditional_execution_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeToolConditionalCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_tool_request_intercept: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, break_chain: bool, cb: NemoRelayNativeToolJsonCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_tool_execution_intercept: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeToolExecutionCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_llm_sanitize_request_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeLlmRequestCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_llm_sanitize_response_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeJsonCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_llm_conditional_execution_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeLlmConditionalCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_llm_request_intercept: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, break_chain: bool, cb: NemoRelayNativeLlmRequestInterceptCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_llm_execution_intercept: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeLlmExecutionCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub plugin_context_register_llm_stream_execution_intercept: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeLlmStreamExecutionCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub scope_handle_free: unsafe extern "C" fn(handle: *mut NemoRelayNativeScopeHandle), pub scope_get_current: unsafe extern "C" fn(out: *mut *mut NemoRelayNativeScopeHandle) -> NemoRelayStatus, pub scope_push: unsafe extern "C" fn(name: *const NemoRelayNativeString, scope_type: NemoRelayNativeScopeType, parent: *const NemoRelayNativeScopeHandle, attributes: u32, data_json: *const NemoRelayNativeString, metadata_json: *const NemoRelayNativeString, input_json: *const NemoRelayNativeString, timestamp_unix_micros: *const i64, out: *mut *mut NemoRelayNativeScopeHandle) -> NemoRelayStatus, pub scope_pop: unsafe extern "C" fn(handle: *const NemoRelayNativeScopeHandle, output_json: *const NemoRelayNativeString, metadata_json: *const NemoRelayNativeString, timestamp_unix_micros: *const i64) -> NemoRelayStatus, pub emit_mark: unsafe extern "C" fn(name: *const NemoRelayNativeString, parent: *const NemoRelayNativeScopeHandle, data_json: *const NemoRelayNativeString, metadata_json: *const NemoRelayNativeString, timestamp_unix_micros: *const i64) -> NemoRelayStatus, pub scope_stack_create: unsafe extern "C" fn(out: *mut *mut NemoRelayNativeScopeStack) -> NemoRelayStatus, pub scope_stack_free: unsafe extern "C" fn(stack: *mut NemoRelayNativeScopeStack), pub scope_stack_set_thread: unsafe extern "C" fn(stack: *const NemoRelayNativeScopeStack) -> NemoRelayStatus, pub scope_stack_capture_thread: unsafe extern "C" fn(out: *mut *mut NemoRelayNativeScopeStackBinding) -> NemoRelayStatus, pub scope_stack_restore_thread: unsafe extern "C" fn(binding: *mut NemoRelayNativeScopeStackBinding) -> NemoRelayStatus, pub scope_stack_binding_free: unsafe extern "C" fn(binding: *mut NemoRelayNativeScopeStackBinding), pub scope_stack_active: unsafe extern "C" fn() -> bool, pub scope_stack_with_current: unsafe extern "C" fn(stack: *const NemoRelayNativeScopeStack, cb: NemoRelayNativeWithScopeStackCb, user_data: *mut c_void) -> NemoRelayStatus,
}
Expand description

Versioned host API table passed to native plugin entry symbols.

Fields§

§abi_version: u32

ABI version implemented by this table.

§struct_size: usize

Size of this struct as seen by the host.

§relay_version: *const c_char

Null-terminated host Relay version string.

§string_new: unsafe extern "C" fn(data: *const u8, len: usize, out: *mut *mut NemoRelayNativeString) -> NemoRelayStatus

Allocates a host-owned string from UTF-8 bytes.

§string_data: unsafe extern "C" fn(value: *const NemoRelayNativeString) -> *const u8

Returns the string data pointer for a host-owned string.

§string_len: unsafe extern "C" fn(value: *const NemoRelayNativeString) -> usize

Returns the byte length for a host-owned string.

§string_free: unsafe extern "C" fn(value: *mut NemoRelayNativeString)

Frees a host-owned string.

§last_error_clear: unsafe extern "C" fn()

Clears the host thread-local native ABI error message.

§last_error_set: unsafe extern "C" fn(message: *const NemoRelayNativeString)

Sets the host thread-local native ABI error message.

§plugin_context_register_subscriber: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, cb: NemoRelayNativeEventSubscriberCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers an event subscriber through the plugin context.

§plugin_context_register_tool_sanitize_request_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeToolJsonCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers a tool sanitize-request guardrail through the plugin context.

§plugin_context_register_tool_sanitize_response_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeToolJsonCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers a tool sanitize-response guardrail through the plugin context.

§plugin_context_register_tool_conditional_execution_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeToolConditionalCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers a tool conditional-execution guardrail through the plugin context.

§plugin_context_register_tool_request_intercept: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, break_chain: bool, cb: NemoRelayNativeToolJsonCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers a tool request intercept through the plugin context.

§plugin_context_register_tool_execution_intercept: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeToolExecutionCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers a tool execution intercept through the plugin context.

§plugin_context_register_llm_sanitize_request_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeLlmRequestCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers an LLM sanitize-request guardrail through the plugin context.

§plugin_context_register_llm_sanitize_response_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeJsonCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers an LLM sanitize-response guardrail through the plugin context.

§plugin_context_register_llm_conditional_execution_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeLlmConditionalCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers an LLM conditional-execution guardrail through the plugin context.

§plugin_context_register_llm_request_intercept: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, break_chain: bool, cb: NemoRelayNativeLlmRequestInterceptCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers an LLM request intercept through the plugin context.

§plugin_context_register_llm_execution_intercept: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeLlmExecutionCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers an LLM execution intercept through the plugin context.

§plugin_context_register_llm_stream_execution_intercept: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeLlmStreamExecutionCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus

Registers an LLM stream execution intercept through the plugin context.

§scope_handle_free: unsafe extern "C" fn(handle: *mut NemoRelayNativeScopeHandle)

Frees a host-owned scope handle.

§scope_get_current: unsafe extern "C" fn(out: *mut *mut NemoRelayNativeScopeHandle) -> NemoRelayStatus

Retrieves the current scope handle from the active stack.

§scope_push: unsafe extern "C" fn(name: *const NemoRelayNativeString, scope_type: NemoRelayNativeScopeType, parent: *const NemoRelayNativeScopeHandle, attributes: u32, data_json: *const NemoRelayNativeString, metadata_json: *const NemoRelayNativeString, input_json: *const NemoRelayNativeString, timestamp_unix_micros: *const i64, out: *mut *mut NemoRelayNativeScopeHandle) -> NemoRelayStatus

Pushes a scope, emits its start event, and returns its handle.

§scope_pop: unsafe extern "C" fn(handle: *const NemoRelayNativeScopeHandle, output_json: *const NemoRelayNativeString, metadata_json: *const NemoRelayNativeString, timestamp_unix_micros: *const i64) -> NemoRelayStatus

Pops a scope handle, emits its end event, and clears scope-local registrations.

§emit_mark: unsafe extern "C" fn(name: *const NemoRelayNativeString, parent: *const NemoRelayNativeScopeHandle, data_json: *const NemoRelayNativeString, metadata_json: *const NemoRelayNativeString, timestamp_unix_micros: *const i64) -> NemoRelayStatus

Emits a mark event under the current or provided parent scope.

§scope_stack_create: unsafe extern "C" fn(out: *mut *mut NemoRelayNativeScopeStack) -> NemoRelayStatus

Creates a new independent scope stack with its own root scope.

§scope_stack_free: unsafe extern "C" fn(stack: *mut NemoRelayNativeScopeStack)

Frees a host-owned scope stack handle.

§scope_stack_set_thread: unsafe extern "C" fn(stack: *const NemoRelayNativeScopeStack) -> NemoRelayStatus

Binds a scope stack to the current OS thread.

§scope_stack_capture_thread: unsafe extern "C" fn(out: *mut *mut NemoRelayNativeScopeStackBinding) -> NemoRelayStatus

Captures the current thread-local scope-stack binding.

§scope_stack_restore_thread: unsafe extern "C" fn(binding: *mut NemoRelayNativeScopeStackBinding) -> NemoRelayStatus

Restores and frees a captured thread-local scope-stack binding.

§scope_stack_binding_free: unsafe extern "C" fn(binding: *mut NemoRelayNativeScopeStackBinding)

Frees a captured thread-local binding without restoring it.

§scope_stack_active: unsafe extern "C" fn() -> bool

Returns whether the current context has an explicitly active scope stack.

§scope_stack_with_current: unsafe extern "C" fn(stack: *const NemoRelayNativeScopeStack, cb: NemoRelayNativeWithScopeStackCb, user_data: *mut c_void) -> NemoRelayStatus

Runs a callback with the provided scope stack visible to host runtime APIs.

Trait Implementations§

Source§

impl Clone for NemoRelayNativeHostApiV1

Source§

fn clone(&self) -> NemoRelayNativeHostApiV1

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for NemoRelayNativeHostApiV1

Source§

impl Send for NemoRelayNativeHostApiV1

Source§

impl Sync for NemoRelayNativeHostApiV1

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.