Skip to main content

NemoRelayNativeHostApiV4

Struct NemoRelayNativeHostApiV4 

Source
#[repr(C)]
pub struct NemoRelayNativeHostApiV4 {
Show 21 fields pub v3: NemoRelayNativeHostApiV3, pub async_completion_llm_request_codec_decode: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion, request_json: *const NemoRelayNativeString, out: *mut *mut NemoRelayNativeString) -> NemoRelayStatus, pub async_completion_llm_request_codec_encode: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion, annotated_json: *const NemoRelayNativeString, original_json: *const NemoRelayNativeString, out: *mut *mut NemoRelayNativeString) -> NemoRelayStatus, pub async_completion_llm_response_codec_decode: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion, response_json: *const NemoRelayNativeString, out: *mut *mut NemoRelayNativeString) -> NemoRelayStatus, pub async_next_open_llm_stream: unsafe extern "C" fn(next: *const NemoRelayNativeAsyncNext, request_json: *const NemoRelayNativeString, cb: NemoRelayNativeAsyncLlmStreamOpenCb, user_data: *mut c_void) -> NemoRelayStatus, pub async_llm_stream_pull: unsafe extern "C" fn(stream: *const NemoRelayNativeLlmAsyncStream, cb: NemoRelayNativeAsyncLlmStreamPullCb, user_data: *mut c_void) -> NemoRelayStatus, pub async_llm_stream_cancel: unsafe extern "C" fn(stream: *const NemoRelayNativeLlmAsyncStream) -> NemoRelayStatus, pub async_llm_stream_release: unsafe extern "C" fn(stream: *const NemoRelayNativeLlmAsyncStream), pub async_completion_retain: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion) -> NemoRelayStatus, pub async_stream_is_backpressured: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream) -> bool, pub emit_mark_v2: NemoRelayNativeEmitMarkV2Fn, pub get_runtime_diagnostics: NemoRelayNativeGetRuntimeDiagnosticsFn, pub plugin_context_runtime: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, out: *mut *const NemoRelayNativePluginRuntime) -> NemoRelayStatus, pub plugin_runtime_retain: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime) -> NemoRelayStatus, pub plugin_runtime_release: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime), pub plugin_runtime_list_registrations: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime, kinds_json: *const NemoRelayNativeString, out_json: *mut *mut NemoRelayNativeString) -> NemoRelayStatus, pub plugin_runtime_register_conditional_middleware_guardrail: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime, name: *const NemoRelayNativeString, kinds_json: *const NemoRelayNativeString, registration_name: *const NemoRelayNativeString, reason: *const NemoRelayNativeString, out_handle: *mut *mut NemoRelayNativeString) -> NemoRelayStatus, pub plugin_runtime_deregister_conditional_middleware_guardrail: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime, handle: *const NemoRelayNativeString, out_removed: *mut bool) -> NemoRelayStatus, pub plugin_context_register_conditional_middleware_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, kinds_json: *const NemoRelayNativeString, registration_name: *const NemoRelayNativeString, reason: *const NemoRelayNativeString) -> NemoRelayStatus, pub plugin_runtime_register_conditional_middleware_guardrail_callback: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime, name: *const NemoRelayNativeString, kinds_json: *const NemoRelayNativeString, registration_name: *const NemoRelayNativeString, cb: NemoRelayNativeConditionalMiddlewareCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn, out_handle: *mut *mut NemoRelayNativeString) -> NemoRelayStatus, pub plugin_context_register_conditional_middleware_guardrail_callback: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, kinds_json: *const NemoRelayNativeString, registration_name: *const NemoRelayNativeString, cb: NemoRelayNativeConditionalMiddlewareCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus,
}
Expand description

ABI-v4 host extension for typed asynchronous middleware, mark options, diagnostics, and activation-owned dynamic gate control.

The complete ABI-v3 table is the prefix, preserving layout compatibility.

Fields§

§v3: NemoRelayNativeHostApiV3

Frozen ABI-v3 compatibility prefix.

§async_completion_llm_request_codec_decode: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion, request_json: *const NemoRelayNativeString, out: *mut *mut NemoRelayNativeString) -> NemoRelayStatus

Decodes an LLM request using the request codec attached to completion.

§async_completion_llm_request_codec_encode: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion, annotated_json: *const NemoRelayNativeString, original_json: *const NemoRelayNativeString, out: *mut *mut NemoRelayNativeString) -> NemoRelayStatus

Encodes an annotated LLM request using the request codec attached to completion.

§async_completion_llm_response_codec_decode: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion, response_json: *const NemoRelayNativeString, out: *mut *mut NemoRelayNativeString) -> NemoRelayStatus

Decodes an LLM response using the response codec attached to completion.

§async_next_open_llm_stream: unsafe extern "C" fn(next: *const NemoRelayNativeAsyncNext, request_json: *const NemoRelayNativeString, cb: NemoRelayNativeAsyncLlmStreamOpenCb, user_data: *mut c_void) -> NemoRelayStatus

Opens an independent pull-based downstream LLM stream.

§async_llm_stream_pull: unsafe extern "C" fn(stream: *const NemoRelayNativeLlmAsyncStream, cb: NemoRelayNativeAsyncLlmStreamPullCb, user_data: *mut c_void) -> NemoRelayStatus

Requests one item from a pull-based downstream LLM stream.

§async_llm_stream_cancel: unsafe extern "C" fn(stream: *const NemoRelayNativeLlmAsyncStream) -> NemoRelayStatus

Cancels a pull-based downstream LLM stream.

§async_llm_stream_release: unsafe extern "C" fn(stream: *const NemoRelayNativeLlmAsyncStream)

Releases the plugin-owned stream reference exactly once.

§async_completion_retain: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion) -> NemoRelayStatus

Retains a completion capability for a codec facade that outlives the callback’s original completion reference.

§async_stream_is_backpressured: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream) -> bool

Returns whether the output queue is currently full.

Use NemoRelayStatus::Backpressured from the individual push or rejection operation to decide whether that operation must be retried.

§emit_mark_v2: NemoRelayNativeEmitMarkV2Fn

Emits a mark with optional data-schema and telemetry-severity fields.

§get_runtime_diagnostics: NemoRelayNativeGetRuntimeDiagnosticsFn

Returns a bounded snapshot of active host runtime diagnostics.

§plugin_context_runtime: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, out: *mut *const NemoRelayNativePluginRuntime) -> NemoRelayStatus

Creates an activation-owned runtime capability from a registration context.

On success, out receives one owned reference. Every owned reference must be released exactly once with plugin_runtime_release.

§plugin_runtime_retain: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime) -> NemoRelayStatus

Retains a runtime capability for a cloned SDK handle.

A successful call creates one additional owned reference.

§plugin_runtime_release: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime)

Releases one owned runtime capability reference.

§plugin_runtime_list_registrations: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime, kinds_json: *const NemoRelayNativeString, out_json: *mut *mut NemoRelayNativeString) -> NemoRelayStatus

Lists global runtime registrations as JSON.

§plugin_runtime_register_conditional_middleware_guardrail: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime, name: *const NemoRelayNativeString, kinds_json: *const NemoRelayNativeString, registration_name: *const NemoRelayNativeString, reason: *const NemoRelayNativeString, out_handle: *mut *mut NemoRelayNativeString) -> NemoRelayStatus

Legacy constant-reason gate registration retained for v4 compatibility.

§plugin_runtime_deregister_conditional_middleware_guardrail: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime, handle: *const NemoRelayNativeString, out_removed: *mut bool) -> NemoRelayStatus

Deregisters an activation-owned gate by opaque handle.

§plugin_context_register_conditional_middleware_guardrail: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, kinds_json: *const NemoRelayNativeString, registration_name: *const NemoRelayNativeString, reason: *const NemoRelayNativeString) -> NemoRelayStatus

Legacy constant-reason component gate retained for v4 compatibility.

§plugin_runtime_register_conditional_middleware_guardrail_callback: unsafe extern "C" fn(runtime: *const NemoRelayNativePluginRuntime, name: *const NemoRelayNativeString, kinds_json: *const NemoRelayNativeString, registration_name: *const NemoRelayNativeString, cb: NemoRelayNativeConditionalMiddlewareCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn, out_handle: *mut *mut NemoRelayNativeString) -> NemoRelayStatus

Registers an activation-owned callback gate and returns its handle.

Relay invokes cb synchronously and consumes user_data on every return path. A null callback reason leaves the target enabled.

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

Declares a callback gate during component registration.

Relay invokes cb synchronously and consumes user_data on every return path. A null callback reason leaves the target enabled.

Trait Implementations§

Source§

impl Clone for NemoRelayNativeHostApiV4

Source§

fn clone(&self) -> NemoRelayNativeHostApiV4

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 NemoRelayNativeHostApiV4

Source§

impl Send for NemoRelayNativeHostApiV4

Source§

impl Sync for NemoRelayNativeHostApiV4

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 = !

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.