Skip to main content

NemoRelayNativeHostApiV3

Struct NemoRelayNativeHostApiV3 

Source
#[repr(C)]
pub struct NemoRelayNativeHostApiV3 {
Show 16 fields pub v1: NemoRelayNativeHostApiV1, pub async_completion_resolve_json: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion, value_json: *const NemoRelayNativeString) -> NemoRelayStatus, pub async_completion_reject: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion, message: *const NemoRelayNativeString) -> NemoRelayStatus, pub async_completion_is_cancelled: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion) -> bool, pub async_completion_release: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion), pub async_next_invoke: unsafe extern "C" fn(next: *const NemoRelayNativeAsyncNext, invocation_json: *const NemoRelayNativeString, completion: *const NemoRelayNativeAsyncCompletion) -> NemoRelayStatus, pub async_next_release: unsafe extern "C" fn(next: *const NemoRelayNativeAsyncNext), pub plugin_context_register_async_middleware: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, kind: u32, name: *const NemoRelayNativeString, priority: i32, break_chain: bool, cb: NemoRelayNativeAsyncMiddlewareCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub async_stream_push_json: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream, chunk_json: *const NemoRelayNativeString) -> NemoRelayStatus, pub async_stream_finish: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream) -> NemoRelayStatus, pub async_stream_reject: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream, message: *const NemoRelayNativeString) -> NemoRelayStatus, pub async_stream_is_cancelled: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream) -> bool, pub async_stream_release: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream), pub async_next_invoke_stream: unsafe extern "C" fn(next: *const NemoRelayNativeAsyncNext, invocation_json: *const NemoRelayNativeString, stream: *const NemoRelayNativeAsyncStream, cb: NemoRelayNativeAsyncNextStreamCb, user_data: *mut c_void) -> NemoRelayStatus, pub plugin_context_register_async_stream_middleware: unsafe extern "C" fn(ctx: *mut NemoRelayNativePluginContext, name: *const NemoRelayNativeString, priority: i32, cb: NemoRelayNativeAsyncStreamMiddlewareCb, user_data: *mut c_void, free_fn: NemoRelayNativeFreeFn) -> NemoRelayStatus, pub async_next_invoke_result: unsafe extern "C" fn(next: *const NemoRelayNativeAsyncNext, invocation_json: *const NemoRelayNativeString, cb: NemoRelayNativeAsyncNextResultCb, user_data: *mut c_void) -> NemoRelayStatus,
}
Expand description

ABI-v3 host extension appended to NemoRelayNativeHostApiV1.

Its first field is the complete v1/v2 table, so legacy plugins can keep treating the pointer as a NemoRelayNativeHostApiV1.

Fields§

§v1: NemoRelayNativeHostApiV1

Compatibility prefix for ABI-v1/v2 plugins.

§async_completion_resolve_json: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion, value_json: *const NemoRelayNativeString) -> NemoRelayStatus

Resolves an async callback completion with a JSON value.

§async_completion_reject: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion, message: *const NemoRelayNativeString) -> NemoRelayStatus

Rejects an async callback completion with a UTF-8 message.

§async_completion_is_cancelled: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion) -> bool

Returns true after the awaiting runtime has cancelled the invocation.

§async_completion_release: unsafe extern "C" fn(completion: *const NemoRelayNativeAsyncCompletion)

Releases the callback-owned reference after a pending completion settles.

§async_next_invoke: unsafe extern "C" fn(next: *const NemoRelayNativeAsyncNext, invocation_json: *const NemoRelayNativeString, completion: *const NemoRelayNativeAsyncCompletion) -> NemoRelayStatus

Invokes an execution continuation and settles a supplied completion.

Cancellation of that completion aborts an in-flight continuation. This legacy convenience hook is one-shot because its result settles the middleware completion; use async_next_invoke_result for repeated or concurrent calls.

§async_next_release: unsafe extern "C" fn(next: *const NemoRelayNativeAsyncNext)

Releases the callback-owned continuation reference.

Execution callbacks must call this exactly once after their final use for both Complete and Pending return states.

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

Registers a completion-based asynchronous middleware surface.

kind must be a valid NemoRelayNativeAsyncMiddlewareKind discriminant. The host rejects unknown u32 values and NemoRelayNativeAsyncMiddlewareKind::LlmStreamExecutionIntercept, which must use plugin_context_register_async_stream_middleware.

§async_stream_push_json: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream, chunk_json: *const NemoRelayNativeString) -> NemoRelayStatus

Pushes one JSON chunk to an incremental native stream without blocking.

A full bounded host queue returns NemoRelayStatus::Internal and records a backpressure message in the host’s last-error slot. The producer may retry the logical chunk after the consumer advances.

§async_stream_finish: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream) -> NemoRelayStatus

Finishes an incremental native stream successfully.

§async_stream_reject: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream, message: *const NemoRelayNativeString) -> NemoRelayStatus

Rejects an incremental native stream without blocking.

A full bounded queue returns NemoRelayStatus::Internal; the caller may retry the rejection after the consumer advances.

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

Returns true when the consumer cancelled or released the stream.

§async_stream_release: unsafe extern "C" fn(stream: *const NemoRelayNativeAsyncStream)

Releases the callback-owned incremental stream reference.

§async_next_invoke_stream: unsafe extern "C" fn(next: *const NemoRelayNativeAsyncNext, invocation_json: *const NemoRelayNativeString, stream: *const NemoRelayNativeAsyncStream, cb: NemoRelayNativeAsyncNextStreamCb, user_data: *mut c_void) -> NemoRelayStatus

Invokes a downstream stream and reports chunks incrementally.

The host reports consumer cancellation through one terminal callback with a non-null error. If a result callback returns false, it must reclaim its own user_data before returning because no terminal callback follows. This hook may be called repeatedly or concurrently with independent callback state while the output stream remains active.

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

Registers an incremental asynchronous LLM stream intercept.

§async_next_invoke_result: unsafe extern "C" fn(next: *const NemoRelayNativeAsyncNext, invocation_json: *const NemoRelayNativeString, cb: NemoRelayNativeAsyncNextResultCb, user_data: *mut c_void) -> NemoRelayStatus

Invokes a unary execution continuation with an independent result sink.

Unlike the legacy completion-coupled async_next_invoke, this hook may be called repeatedly or concurrently with distinct user_data.

Trait Implementations§

Source§

impl Clone for NemoRelayNativeHostApiV3

Source§

fn clone(&self) -> NemoRelayNativeHostApiV3

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 NemoRelayNativeHostApiV3

Source§

impl Send for NemoRelayNativeHostApiV3

Source§

impl Sync for NemoRelayNativeHostApiV3

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.