> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server. # nemo-relay-plugin > Stable native plugin ABI and Rust authoring helpers for NeMo Relay. Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker`. Stable native plugin ABI and Rust authoring helpers for NeMo Relay. This crate intentionally does not depend on the `nemo-relay` runtime crate. Native plugins built with it communicate with a host through versioned C-compatible tables and host-owned string handles. ## Macros * [nemo\_relay\_plugin](/reference/api/rust-library-reference/nemo-relay-plugin/macro-nemo-relay-plugin): Exports a concrete plugin constructor as a native plugin entry symbol body. ## Structs * [AnnotatedLlmRequest](/reference/api/rust-library-reference/nemo-relay-plugin/struct-annotatedllmrequest): Structured view of an LLM request, produced by a Codec from opaque [`LlmRequest`](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmrequest) content. * [AnnotatedLlmResponse](/reference/api/rust-library-reference/nemo-relay-plugin/struct-annotatedllmresponse): Structured view of an LLM response, produced by a response codec from raw JSON API output. * [CategoryProfile](/reference/api/rust-library-reference/nemo-relay-plugin/struct-categoryprofile): Category-specific profile data. * [ConditionalMiddlewareGuardrailHandle](/reference/api/rust-library-reference/nemo-relay-plugin/struct-conditionalmiddlewareguardrailhandle): Opaque activation-owned handle for a native plugin's dynamic gate. * [ConfigDiagnostic](/reference/api/rust-library-reference/nemo-relay-plugin/struct-configdiagnostic): Structured validation diagnostic for plugin validation. * [DataSchema](/reference/api/rust-library-reference/nemo-relay-plugin/struct-dataschema): Identifier for the schema that describes an event's opaque `data` payload. * [EventCategory](/reference/api/rust-library-reference/nemo-relay-plugin/struct-eventcategory): Semantic category carried by ATOF `category`. * [EventSanitizeFields](/reference/api/rust-library-reference/nemo-relay-plugin/struct-eventsanitizefields): Observability fields that event sanitizers may rewrite. * [LlmAttributes](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmattributes): Bitflags that modify LLM-call behavior and observability. * [LlmNext](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmnext): Cloneable asynchronous LLM execution continuation. * [LlmOptimizationContribution](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationcontribution): One optimizer's evidence for a change to an LLM call. * [LlmOptimizationKind](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationkind): Open, forward-compatible optimization classification. * [LlmOptimizationModel](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationmodel): Model identity used for counterfactual and effective pricing. * [LlmOptimizationModelTransition](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationmodeltransition): A model change proposed or applied by an optimizer. * [LlmOptimizationSummary](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationsummary): Close-time accounting attached to the normalized LLM response. * [LlmOptimizationTokenImpact](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationtokenimpact): Shared token evidence that Relay can aggregate without understanding a plugin payload. * [LlmOptimizationTokens](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationtokens): Token quantities retained independently from pricing arithmetic. * [LlmRequest](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmrequest): JSON-shaped LLM request payload passed through the runtime. * [LlmRequestInterceptOutcome](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmrequestinterceptoutcome): Result of an LLM request intercept that can schedule lifecycle marks. * [LlmSanitizeRequestCodec](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmsanitizerequestcodec): Safe completion-backed request codec facade for typed native plugins. * [LlmSanitizeRequestContext](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmsanitizerequestcontext): Per-call request codec context delivered to an LLM sanitizer. * [LlmSanitizeResponseCodec](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmsanitizeresponsecodec): Safe completion-backed response codec facade for typed native plugins. * [LlmSanitizeResponseContext](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmsanitizeresponsecontext): Per-call response codec context delivered to an LLM sanitizer. * [LlmStream](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmstream): Host- or plugin-owned stream returned across the native LLM stream ABI. * [LlmStreamNext](/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmstreamnext): Cloneable asynchronous LLM stream continuation. * [MetricEnvelope](/reference/api/rust-library-reference/nemo-relay-plugin/struct-metricenvelope): Payload stored in a mark using [`METRIC_DATA_SCHEMA_NAME`](/reference/api/rust-library-reference/nemo-relay-plugin/constant-metric-data-schema-name). * [MetricMeasurement](/reference/api/rust-library-reference/nemo-relay-plugin/struct-metricmeasurement): One recording operation in a Relay metric mark. * [NativeExecutorConfig](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nativeexecutorconfig): Configuration for the executor owned by one exported native plugin. * [NemoRelayNativeAsyncCompletion](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativeasynccompletion): Opaque one-shot completion retained by a pending native callback. * [NemoRelayNativeAsyncNext](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativeasyncnext): Opaque native execution continuation supplied only to execution intercepts. * [NemoRelayNativeAsyncStream](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativeasyncstream): Opaque incremental output channel supplied to native async stream intercepts. * [NemoRelayNativeHostApiV1](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativehostapiv1): Versioned host API table passed to native plugin entry symbols. * [NemoRelayNativeHostApiV3](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativehostapiv3): ABI-v3 host extension appended to [`NemoRelayNativeHostApiV1`](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativehostapiv1). * [NemoRelayNativeHostApiV4](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativehostapiv4): ABI-v4 host extension for typed asynchronous middleware, mark options, diagnostics, and activation-owned dynamic gate control. * [NemoRelayNativeLlmAsyncStream](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmasyncstream): Opaque pull-based downstream LLM stream owned by the host. * [NemoRelayNativeLlmRequestCodec](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmrequestcodec): Opaque callback-scoped request codec capability owned by the host. * [NemoRelayNativeLlmResponseCodec](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmresponsecodec): Opaque callback-scoped response codec capability owned by the host. * [NemoRelayNativeLlmSanitizeRequestContext](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmsanitizerequestcontext): Per-call LLM sanitizer context passed over the native ABI. * [NemoRelayNativeLlmSanitizeResponseContext](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmsanitizeresponsecontext): Per-call response sanitizer context passed over the native ABI. * [NemoRelayNativeLlmStreamV1](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmstreamv1): Native LLM JSON stream handle table. * [NemoRelayNativePluginContext](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativeplugincontext): Opaque plugin registration context borrowed from the host during registration. * [NemoRelayNativePluginRuntime](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativepluginruntime): Opaque activation-owned runtime capability used by native plugins. * [NemoRelayNativePluginV1](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativepluginv1): Versioned plugin descriptor returned by native plugin entry symbols. * [NemoRelayNativeScopeHandle](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativescopehandle): Opaque host-owned scope handle. * [NemoRelayNativeScopeStack](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativescopestack): Opaque host-owned scope stack handle. * [NemoRelayNativeScopeStackBinding](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativescopestackbinding): Opaque host-owned captured scope-stack binding. * [NemoRelayNativeString](/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativestring): Opaque host-owned UTF-8 string or JSON byte buffer. * [PendingMarkSpec](/reference/api/rust-library-reference/nemo-relay-plugin/struct-pendingmarkspec): Mark requested by middleware for materialization by a lifecycle owner. * [PluginContext](/reference/api/rust-library-reference/nemo-relay-plugin/struct-plugincontext): Borrowed safe wrapper around a host plugin registration context. * [PluginRuntime](/reference/api/rust-library-reference/nemo-relay-plugin/struct-pluginruntime): Cloneable high-level runtime handle for host APIs available to native plugins. * [RuntimeDiagnostic](/reference/api/rust-library-reference/nemo-relay-plugin/struct-runtimediagnostic): One bounded runtime diagnostic reported by the Relay host. * [RuntimeDiagnostics](/reference/api/rust-library-reference/nemo-relay-plugin/struct-runtimediagnostics): Bounded snapshot of active host runtime diagnostics. * [RuntimeRegistrationIdentity](/reference/api/rust-library-reference/nemo-relay-plugin/struct-runtimeregistrationidentity): Structured identity for a global gateable runtime registration. * [RuntimeRegistrationOwner](/reference/api/rust-library-reference/nemo-relay-plugin/struct-runtimeregistrationowner): Discovery metadata describing the owner of a runtime registration. * [ScopeAttributes](/reference/api/rust-library-reference/nemo-relay-plugin/struct-scopeattributes): Bitflags that modify scope behavior and observability. * [ScopeGuard](/reference/api/rust-library-reference/nemo-relay-plugin/struct-scopeguard): RAII guard for a host scope opened by [`PluginRuntime::scope`](/reference/api/rust-library-reference/nemo-relay-plugin/struct-pluginruntime). * [ScopeHandle](/reference/api/rust-library-reference/nemo-relay-plugin/struct-scopehandle): Host-owned scope handle returned by native scope APIs. * [ScopeStack](/reference/api/rust-library-reference/nemo-relay-plugin/struct-scopestack): Host-owned isolated scope stack returned by native scope-stack APIs. * [ScopeStackBinding](/reference/api/rust-library-reference/nemo-relay-plugin/struct-scopestackbinding): Captured thread-local scope-stack binding. * [ThreadScopeStackGuard](/reference/api/rust-library-reference/nemo-relay-plugin/struct-threadscopestackguard): RAII guard that restores the previous thread-local scope stack on drop. * [ToolAttributes](/reference/api/rust-library-reference/nemo-relay-plugin/struct-toolattributes): Bitflags that modify tool-call behavior and observability. * [ToolExecutionInterceptOutcome](/reference/api/rust-library-reference/nemo-relay-plugin/struct-toolexecutioninterceptoutcome): Canonical result returned by a tool execution intercept. * [ToolExecutionResult](/reference/api/rust-library-reference/nemo-relay-plugin/struct-toolexecutionresult): Canonical application-visible result of tool execution. * [ToolNext](/reference/api/rust-library-reference/nemo-relay-plugin/struct-toolnext): Cloneable asynchronous tool execution continuation. ## Enums * [BuiltinLlmCodec](/reference/api/rust-library-reference/nemo-relay-plugin/enum-builtinllmcodec): Relay's built-in LLM codec identities. * [DiagnosticLevel](/reference/api/rust-library-reference/nemo-relay-plugin/enum-diagnosticlevel): Diagnostic severity returned by plugin validation. * [Event](/reference/api/rust-library-reference/nemo-relay-plugin/enum-event): Tagged union covering the two ATOF event kinds emitted by the runtime. * [HandleAttributes](/reference/api/rust-library-reference/nemo-relay-plugin/enum-handleattributes): Attribute bitflags attached to a concrete handle kind. * [LlmCodecIdentity](/reference/api/rust-library-reference/nemo-relay-plugin/enum-llmcodecidentity): Per-call LLM codec identity supplied to sanitizer and SDK callbacks. * [LlmOptimizationEvidenceQuality](/reference/api/rust-library-reference/nemo-relay-plugin/enum-llmoptimizationevidencequality): Whether token evidence was observed directly or estimated. * [LlmOptimizationSummaryStatus](/reference/api/rust-library-reference/nemo-relay-plugin/enum-llmoptimizationsummarystatus): Completeness of close-time optimization accounting. * [LogSeverity](/reference/api/rust-library-reference/nemo-relay-plugin/enum-logseverity): Severity attached to a mark that may be projected as an OpenTelemetry log. * [MetricKind](/reference/api/rust-library-reference/nemo-relay-plugin/enum-metrickind): OpenTelemetry instrument kind represented by a metric measurement mark. * [MetricValueType](/reference/api/rust-library-reference/nemo-relay-plugin/enum-metricvaluetype): Numeric representation used by a metric measurement. * [NemoRelayNativeAsyncCallbackState](/reference/api/rust-library-reference/nemo-relay-plugin/enum-nemorelaynativeasynccallbackstate): Indicates whether an asynchronous native callback settled before returning. * [NemoRelayNativeAsyncMiddlewareKind](/reference/api/rust-library-reference/nemo-relay-plugin/enum-nemorelaynativeasyncmiddlewarekind): Middleware surface selected by the native async registration hook. * [NemoRelayNativeLlmCodecKind](/reference/api/rust-library-reference/nemo-relay-plugin/enum-nemorelaynativellmcodeckind): Discriminator for the codec supplied to an LLM sanitizer over the native ABI. * [NemoRelayNativeScopeType](/reference/api/rust-library-reference/nemo-relay-plugin/enum-nemorelaynativescopetype): Scope category used by native plugins when opening scopes. * [NemoRelayStatus](/reference/api/rust-library-reference/nemo-relay-plugin/enum-nemorelaystatus): Status codes returned by stable native ABI functions. * [RuntimeRegistrationKind](/reference/api/rust-library-reference/nemo-relay-plugin/enum-runtimeregistrationkind): A global runtime registration surface that can be selected by a conditional middleware guardrail. * [RuntimeRegistrationOwnerKind](/reference/api/rust-library-reference/nemo-relay-plugin/enum-runtimeregistrationownerkind): The owner category reported for a global runtime registration. * [ScopeCategory](/reference/api/rust-library-reference/nemo-relay-plugin/enum-scopecategory): Agent Trajectory Observability Format (ATOF) lifecycle phase for a scope event. * [ScopeType](/reference/api/rust-library-reference/nemo-relay-plugin/enum-scopetype): Semantic category attached to a scope lifecycle span. ## Constants * [METRIC\_DATA\_SCHEMA\_NAME](/reference/api/rust-library-reference/nemo-relay-plugin/constant-metric-data-schema-name): Relay-owned schema name for mark payloads containing metric measurements. * [METRIC\_DATA\_SCHEMA\_VERSION](/reference/api/rust-library-reference/nemo-relay-plugin/constant-metric-data-schema-version): Current Relay-owned metric measurement schema version. * [NEMO\_RELAY\_NATIVE\_ABI\_VERSION](/reference/api/rust-library-reference/nemo-relay-plugin/constant-nemo-relay-native-abi-version): Native plugin ABI version supported by this crate. * [NEMO\_RELAY\_NATIVE\_ABI\_VERSION\_ASYNC\_MIDDLEWARE](/reference/api/rust-library-reference/nemo-relay-plugin/constant-nemo-relay-native-abi-version-async-middleware): ABI version that introduced completion-based asynchronous middleware. * [NEMO\_RELAY\_NATIVE\_ABI\_VERSION\_LEGACY](/reference/api/rust-library-reference/nemo-relay-plugin/constant-nemo-relay-native-abi-version-legacy): Legacy native plugin ABI accepted by Relay hosts for compatibility. * [TOOL\_EXECUTION\_INTERCEPT\_OUTCOME\_SCHEMA](/reference/api/rust-library-reference/nemo-relay-plugin/constant-tool-execution-intercept-outcome-schema): Versioned native-plugin JSON envelope schema for [`ToolExecutionInterceptOutcome`](/reference/api/rust-library-reference/nemo-relay-plugin/struct-toolexecutioninterceptoutcome). * [TOOL\_EXECUTION\_RESULT\_SCHEMA](/reference/api/rust-library-reference/nemo-relay-plugin/constant-tool-execution-result-schema): Versioned native-plugin JSON envelope schema for [`ToolExecutionResult`](/reference/api/rust-library-reference/nemo-relay-plugin/struct-toolexecutionresult). ## Traits * [LlmOptimizationPayload](/reference/api/rust-library-reference/nemo-relay-plugin/trait-llmoptimizationpayload): Trait implemented by typed plugin payloads embedded in an optimization contribution. * [NativePlugin](/reference/api/rust-library-reference/nemo-relay-plugin/trait-nativeplugin): Trait implemented by Rust native plugins. ## Functions * [capture\_scope\_stack\_thread](/reference/api/rust-library-reference/nemo-relay-plugin/fn-capture-scope-stack-thread): Captures the current thread-local scope-stack binding. * [create\_scope\_stack](/reference/api/rust-library-reference/nemo-relay-plugin/fn-create-scope-stack): Creates a new independent scope stack. * [current\_scope](/reference/api/rust-library-reference/nemo-relay-plugin/fn-current-scope): Retrieves the current scope handle. * [emit\_mark](/reference/api/rust-library-reference/nemo-relay-plugin/fn-emit-mark): Emits a mark event under the current scope. * [export\_plugin](/reference/api/rust-library-reference/nemo-relay-plugin/fn-export-plugin): Initializes a native plugin descriptor for a Rust SDK plugin value. * [pop\_scope](/reference/api/rust-library-reference/nemo-relay-plugin/fn-pop-scope): Pops a scope and emits its end event. * [push\_scope](/reference/api/rust-library-reference/nemo-relay-plugin/fn-push-scope): Pushes a scope and emits its start event. ## Type Aliases * [Json](/reference/api/rust-library-reference/nemo-relay-plugin/type-json): Type alias for [`serde_json::Value`](https://docs.rs/serde_json/1.0.149/serde_json/value/enum.Value.html), used as the universal JSON representation throughout NeMo Relay APIs. * [LlmJsonAsyncStream](/reference/api/rust-library-reference/nemo-relay-plugin/type-llmjsonasyncstream): Asynchronous JSON stream returned by a native typed stream interceptor. * [LlmJsonStream](/reference/api/rust-library-reference/nemo-relay-plugin/type-llmjsonstream): Synchronous JSON chunk stream used by native LLM stream intercept helpers. * [NemoRelayNativeAsyncLlmStreamOpenCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncllmstreamopencb): Receives the result of asynchronously opening a downstream LLM stream. * [NemoRelayNativeAsyncLlmStreamPullCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncllmstreampullcb): Receives one item from a pull-based downstream LLM stream. * [NemoRelayNativeAsyncMiddlewareCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncmiddlewarecb): Completion-based native middleware callback. * [NemoRelayNativeAsyncNextResultCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncnextresultcb): Receives one completion from a unary execution-continuation invocation. * [NemoRelayNativeAsyncNextStreamCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncnextstreamcb): Receives one downstream stream item. `chunk_json` is non-null for a chunk, `error` is non-null for failure or consumer cancellation, and `done` marks clean completion. Unless the callback itself returns `false`, the host invokes one terminal callback so the plugin can reclaim `user_data`. Return `false` to cancel downstream production after the current callback; in that case, reclaim `user_data` before returning because no later callback is made. * [NemoRelayNativeAsyncStreamMiddlewareCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncstreammiddlewarecb): Incremental native LLM stream intercept callback. * [NemoRelayNativeConditionalMiddlewareCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeconditionalmiddlewarecb): Native callback deciding whether a matching runtime registration is eligible. * [NemoRelayNativeEmitMarkV2Fn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeemitmarkv2fn): Extended native mark-emission function introduced in ABI v4. * [NemoRelayNativeEventSanitizeCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeeventsanitizecb): Native event observability-field sanitizer callback. * [NemoRelayNativeEventSubscriberCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeeventsubscribercb): Native event subscriber callback. * [NemoRelayNativeFreeFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativefreefn): Optional destructor for user data captured by native callbacks. * [NemoRelayNativeGetRuntimeDiagnosticsFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativegetruntimediagnosticsfn): Reads the active host runtime-diagnostics snapshot as canonical JSON. * [NemoRelayNativeLlmConditionalCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmconditionalcb): Native LLM conditional-execution callback. * [NemoRelayNativeLlmExecutionCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmexecutioncb): Native LLM execution intercept callback. * [NemoRelayNativeLlmNextFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmnextfn): Runtime-provided continuation for LLM execution intercepts. * [NemoRelayNativeLlmRequestInterceptCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmrequestinterceptcb): Native LLM request intercept callback. * [NemoRelayNativeLlmSanitizeRequestCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmsanitizerequestcb): Native LLM request sanitizer callback. Return a successful null output to omit the observability payload and annotation. `request_json` is borrowed, but may be written directly to `out_request_json` as a pass-through; the host releases an aliased input/output once. Any other non-null output must be host-allocated and transfers ownership to the host. * [NemoRelayNativeLlmSanitizeResponseCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmsanitizeresponsecb): Native LLM response sanitizer callback. Return a successful null output to omit the observability payload and annotation. `payload_json` is borrowed, but may be written directly to `out_json` as a pass-through; the host releases an aliased input/output once. Any other non-null output must be host-allocated and transfers ownership to the host. * [NemoRelayNativeLlmStreamCancelFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmstreamcancelfn): Optional native stream cancellation callback. * [NemoRelayNativeLlmStreamDropFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmstreamdropfn): Optional native stream destructor callback. * [NemoRelayNativeLlmStreamExecutionCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmstreamexecutioncb): Native LLM stream execution intercept callback. * [NemoRelayNativeLlmStreamNextFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmstreamnextfn): Runtime-provided continuation for LLM stream execution intercepts. * [NemoRelayNativeLlmStreamPollFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmstreampollfn): Native stream poll callback. * [NemoRelayNativePluginDropFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeplugindropfn): Native plugin drop callback. * [NemoRelayNativePluginEntry](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativepluginentry): Native entry symbol type loaded by the host. * [NemoRelayNativePluginRegisterFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativepluginregisterfn): Native plugin registration callback. * [NemoRelayNativePluginValidateFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativepluginvalidatefn): Native plugin validation callback. * [NemoRelayNativeToolConditionalCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativetoolconditionalcb): Native tool conditional-execution callback. * [NemoRelayNativeToolExecutionCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativetoolexecutioncb): Native tool execution intercept callback. * [NemoRelayNativeToolJsonCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativetooljsoncb): Native JSON transform callback for tool request/response sanitizers and tool request intercepts. * [NemoRelayNativeToolNextFn](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativetoolnextfn): Runtime-provided continuation for tool execution intercepts. * [NemoRelayNativeWithScopeStackCb](/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativewithscopestackcb): Native callback executed while a host scope stack is temporarily active. * [Result](/reference/api/rust-library-reference/nemo-relay-plugin/type-result): Result type used by the Rust native plugin SDK. > Stable native plugin ABI and Rust authoring helpers for NeMo Relay. ## Docs - [Macro nemo_relay_plugin](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/macro-nemo-relay-plugin.md): Exports a concrete plugin constructor as a native plugin entry symbol body. - [Struct Annotated LlmRequest](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-annotatedllmrequest.md): Structured view of an LLM request, produced by a Codec from opaque `LlmRequest` content. - [Struct Annotated LlmResponse](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-annotatedllmresponse.md): Structured view of an LLM response, produced by a response codec from raw JSON API output. - [Struct Category Profile](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-categoryprofile.md): Category-specific profile data. - [Struct Conditional Middleware Guardrail Handle](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-conditionalmiddlewareguardrailhandle.md): Opaque activation-owned handle for a native plugin's dynamic gate. - [Struct Config Diagnostic](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-configdiagnostic.md): Structured validation diagnostic for plugin validation. - [Struct Data Schema](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-dataschema.md): Identifier for the schema that describes an event's opaque `data` payload. - [Struct Event Category](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-eventcategory.md): Semantic category carried by ATOF `category`. - [Struct Event Sanitize Fields](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-eventsanitizefields.md): Observability fields that event sanitizers may rewrite. - [Struct LlmAttributes](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmattributes.md): Bitflags that modify LLM-call behavior and observability. - [Struct LlmNext](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmnext.md): Cloneable asynchronous LLM execution continuation. - [Struct LlmOptimization Contribution](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationcontribution.md): One optimizer's evidence for a change to an LLM call. - [Struct LlmOptimization Kind](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationkind.md): Open, forward-compatible optimization classification. - [Struct LlmOptimization Model](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationmodel.md): Model identity used for counterfactual and effective pricing. - [Struct LlmOptimization Model Transition](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationmodeltransition.md): A model change proposed or applied by an optimizer. - [Struct LlmOptimization Summary](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationsummary.md): Close-time accounting attached to the normalized LLM response. - [Struct LlmOptimization Token Impact](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationtokenimpact.md): Shared token evidence that Relay can aggregate without understanding a plugin payload. - [Struct LlmOptimization Tokens](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmoptimizationtokens.md): Token quantities retained independently from pricing arithmetic. - [Struct LlmRequest](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmrequest.md): JSON-shaped LLM request payload passed through the runtime. - [Struct LlmRequest Intercept Outcome](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmrequestinterceptoutcome.md): Result of an LLM request intercept that can schedule lifecycle marks. - [Struct LlmSanitize Request Codec](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmsanitizerequestcodec.md): Safe completion-backed request codec facade for typed native plugins. - [Struct LlmSanitize Request Context](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmsanitizerequestcontext.md): Per-call request codec context delivered to an LLM sanitizer. - [Struct LlmSanitize Response Codec](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmsanitizeresponsecodec.md): Safe completion-backed response codec facade for typed native plugins. - [Struct LlmSanitize Response Context](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmsanitizeresponsecontext.md): Per-call response codec context delivered to an LLM sanitizer. - [Struct LlmStream](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmstream.md): Host- or plugin-owned stream returned across the native LLM stream ABI. - [Struct LlmStream Next](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-llmstreamnext.md): Cloneable asynchronous LLM stream continuation. - [Struct Metric Envelope](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-metricenvelope.md): Payload stored in a mark using `METRIC_DATA_SCHEMA_NAME`. - [Struct Metric Measurement](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-metricmeasurement.md): One recording operation in a Relay metric mark. - [Struct Native Executor Config](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nativeexecutorconfig.md): Configuration for the executor owned by one exported native plugin. - [Struct Nemo Relay Native Async Completion](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativeasynccompletion.md): Opaque one-shot completion retained by a pending native callback. - [Struct Nemo Relay Native Async Next](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativeasyncnext.md): Opaque native execution continuation supplied only to execution intercepts. - [Struct Nemo Relay Native Async Stream](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativeasyncstream.md): Opaque incremental output channel supplied to native async stream intercepts. - [Struct Nemo Relay Native Host ApiV1](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativehostapiv1.md): Versioned host API table passed to native plugin entry symbols. - [Struct Nemo Relay Native Host ApiV3](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativehostapiv3.md): ABI-v3 host extension appended to `NemoRelayNativeHostApiV1`. - [Struct Nemo Relay Native Host ApiV4](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativehostapiv4.md): ABI-v4 host extension for typed asynchronous middleware, mark options, diagnostics, and activation-owned dynamic gate control. - [Struct Nemo Relay Native LlmAsync Stream](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmasyncstream.md): Opaque pull-based downstream LLM stream owned by the host. - [Struct Nemo Relay Native LlmRequest Codec](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmrequestcodec.md): Opaque callback-scoped request codec capability owned by the host. - [Struct Nemo Relay Native LlmResponse Codec](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmresponsecodec.md): Opaque callback-scoped response codec capability owned by the host. - [Struct Nemo Relay Native LlmSanitize Request Context](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmsanitizerequestcontext.md): Per-call LLM sanitizer context passed over the native ABI. - [Struct Nemo Relay Native LlmSanitize Response Context](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmsanitizeresponsecontext.md): Per-call response sanitizer context passed over the native ABI. - [Struct Nemo Relay Native LlmStream V1](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativellmstreamv1.md): Native LLM JSON stream handle table. - [Struct Nemo Relay Native Plugin Context](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativeplugincontext.md): Opaque plugin registration context borrowed from the host during registration. - [Struct Nemo Relay Native Plugin Runtime](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativepluginruntime.md): Opaque activation-owned runtime capability used by native plugins. - [Struct Nemo Relay Native Plugin V1](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativepluginv1.md): Versioned plugin descriptor returned by native plugin entry symbols. - [Struct Nemo Relay Native Scope Handle](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativescopehandle.md): Opaque host-owned scope handle. - [Struct Nemo Relay Native Scope Stack](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativescopestack.md): Opaque host-owned scope stack handle. - [Struct Nemo Relay Native Scope Stack Binding](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativescopestackbinding.md): Opaque host-owned captured scope-stack binding. - [Struct Nemo Relay Native String](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-nemorelaynativestring.md): Opaque host-owned UTF-8 string or JSON byte buffer. - [Struct Pending Mark Spec](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-pendingmarkspec.md): Mark requested by middleware for materialization by a lifecycle owner. - [Struct Plugin Context](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-plugincontext.md): Borrowed safe wrapper around a host plugin registration context. - [Struct Plugin Runtime](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-pluginruntime.md): Cloneable high-level runtime handle for host APIs available to native plugins. - [Struct Runtime Diagnostic](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-runtimediagnostic.md): One bounded runtime diagnostic reported by the Relay host. - [Struct Runtime Diagnostics](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-runtimediagnostics.md): Bounded snapshot of active host runtime diagnostics. - [Struct Runtime Registration Identity](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-runtimeregistrationidentity.md): Structured identity for a global gateable runtime registration. - [Struct Runtime Registration Owner](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-runtimeregistrationowner.md): Discovery metadata describing the owner of a runtime registration. - [Struct Scope Attributes](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-scopeattributes.md): Bitflags that modify scope behavior and observability. - [Struct Scope Guard](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-scopeguard.md): RAII guard for a host scope opened by `PluginRuntime::scope`. - [Struct Scope Handle](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-scopehandle.md): Host-owned scope handle returned by native scope APIs. - [Struct Scope Stack](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-scopestack.md): Host-owned isolated scope stack returned by native scope-stack APIs. - [Struct Scope Stack Binding](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-scopestackbinding.md): Captured thread-local scope-stack binding. - [Struct Thread Scope Stack Guard](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-threadscopestackguard.md): RAII guard that restores the previous thread-local scope stack on drop. - [Struct Tool Attributes](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-toolattributes.md): Bitflags that modify tool-call behavior and observability. - [Struct Tool Execution Intercept Outcome](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-toolexecutioninterceptoutcome.md): Canonical result returned by a tool execution intercept. - [Struct Tool Execution Result](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-toolexecutionresult.md): Canonical application-visible result of tool execution. - [Struct Tool Next](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/struct-toolnext.md): Cloneable asynchronous tool execution continuation. - [Enum Builtin LlmCodec](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-builtinllmcodec.md): Relay's built-in LLM codec identities. - [Enum Diagnostic Level](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-diagnosticlevel.md): Diagnostic severity returned by plugin validation. - [Enum Event](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-event.md): Tagged union covering the two ATOF event kinds emitted by the runtime. - [Enum Handle Attributes](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-handleattributes.md): Attribute bitflags attached to a concrete handle kind. - [Enum LlmCodec Identity](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-llmcodecidentity.md): Per-call LLM codec identity supplied to sanitizer and SDK callbacks. - [Enum LlmOptimization Evidence Quality](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-llmoptimizationevidencequality.md): Whether token evidence was observed directly or estimated. - [Enum LlmOptimization Summary Status](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-llmoptimizationsummarystatus.md): Completeness of close-time optimization accounting. - [Enum LogSeverity](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-logseverity.md): Severity attached to a mark that may be projected as an OpenTelemetry log. - [Enum Metric Kind](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-metrickind.md): OpenTelemetry instrument kind represented by a metric measurement mark. - [Enum Metric Value Type](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-metricvaluetype.md): Numeric representation used by a metric measurement. - [Enum Nemo Relay Native Async Callback State](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-nemorelaynativeasynccallbackstate.md): Indicates whether an asynchronous native callback settled before returning. - [Enum Nemo Relay Native Async Middleware Kind](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-nemorelaynativeasyncmiddlewarekind.md): Middleware surface selected by the native async registration hook. - [Enum Nemo Relay Native LlmCodec Kind](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-nemorelaynativellmcodeckind.md): Discriminator for the codec supplied to an LLM sanitizer over the native ABI. - [Enum Nemo Relay Native Scope Type](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-nemorelaynativescopetype.md): Scope category used by native plugins when opening scopes. - [Enum Nemo Relay Status](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-nemorelaystatus.md): Status codes returned by stable native ABI functions. - [Enum Runtime Registration Kind](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-runtimeregistrationkind.md): A global runtime registration surface that can be selected by a conditional middleware guardrail. - [Enum Runtime Registration Owner Kind](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-runtimeregistrationownerkind.md): The owner category reported for a global runtime registration. - [Enum Scope Category](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-scopecategory.md): Agent Trajectory Observability Format (ATOF) lifecycle phase for a scope event. - [Enum Scope Type](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/enum-scopetype.md): Semantic category attached to a scope lifecycle span. - [Constant METRIC_DATA_SCHEMA_NAME](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/constant-metric-data-schema-name.md): Relay-owned schema name for mark payloads containing metric measurements. - [Constant METRIC_DATA_SCHEMA_VERSION](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/constant-metric-data-schema-version.md): Current Relay-owned metric measurement schema version. - [Constant NEMO_RELAY_NATIVE_ABI_VERSION](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/constant-nemo-relay-native-abi-version.md): Native plugin ABI version supported by this crate. - [Constant NEMO_RELAY_NATIVE_ABI_VERSION_ASYNC_MIDDLEWARE](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/constant-nemo-relay-native-abi-version-async-middleware.md): ABI version that introduced completion-based asynchronous middleware. - [Constant NEMO_RELAY_NATIVE_ABI_VERSION_LEGACY](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/constant-nemo-relay-native-abi-version-legacy.md): Legacy native plugin ABI accepted by Relay hosts for compatibility. - [Constant TOOL_EXECUTION_INTERCEPT_OUTCOME_SCHEMA](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/constant-tool-execution-intercept-outcome-schema.md): Versioned native-plugin JSON envelope schema for `ToolExecutionInterceptOutcome`. - [Constant TOOL_EXECUTION_RESULT_SCHEMA](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/constant-tool-execution-result-schema.md): Versioned native-plugin JSON envelope schema for `ToolExecutionResult`. - [Trait LlmOptimization Payload](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/trait-llmoptimizationpayload.md): Trait implemented by typed plugin payloads embedded in an optimization contribution. - [Trait Native Plugin](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/trait-nativeplugin.md): Trait implemented by Rust native plugins. - [Function capture_scope_stack_thread](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/fn-capture-scope-stack-thread.md): Captures the current thread-local scope-stack binding. - [Function create_scope_stack](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/fn-create-scope-stack.md): Creates a new independent scope stack. - [Function current_scope](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/fn-current-scope.md): Retrieves the current scope handle. - [Function emit_mark](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/fn-emit-mark.md): Emits a mark event under the current scope. - [Function export_plugin](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/fn-export-plugin.md): Initializes a native plugin descriptor for a Rust SDK plugin value. - [Function pop_scope](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/fn-pop-scope.md): Pops a scope and emits its end event. - [Function push_scope](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/fn-push-scope.md): Pushes a scope and emits its start event. - [Type Alias Json](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-json.md): Type alias for `serde_json::Value`, used as the universal JSON representation throughout NeMo Relay APIs. - [Type Alias LlmJson Async Stream](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-llmjsonasyncstream.md): Asynchronous JSON stream returned by a native typed stream interceptor. - [Type Alias LlmJson Stream](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-llmjsonstream.md): Synchronous JSON chunk stream used by native LLM stream intercept helpers. - [Type Alias Nemo Relay Native Async LlmStream Open Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncllmstreamopencb.md): Receives the result of asynchronously opening a downstream LLM stream. - [Type Alias Nemo Relay Native Async LlmStream Pull Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncllmstreampullcb.md): Receives one item from a pull-based downstream LLM stream. - [Type Alias Nemo Relay Native Async Middleware Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncmiddlewarecb.md): Completion-based native middleware callback. - [Type Alias Nemo Relay Native Async Next Result Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncnextresultcb.md): Receives one completion from a unary execution-continuation invocation. - [Type Alias Nemo Relay Native Async Next Stream Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncnextstreamcb.md): Receives one downstream stream item. `chunk_json` is non-null for a chunk, `error` is non-null for failure or consumer cancellation, and `done` marks clean completion. Unless the callback itself returns `false`, the host invokes one terminal callback so the plugin can reclaim `user_data`. Return `false` to cancel downstream production after the current callback; in that case, reclaim `user_data` before returning because no later callback is made. - [Type Alias Nemo Relay Native Async Stream Middleware Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeasyncstreammiddlewarecb.md): Incremental native LLM stream intercept callback. - [Type Alias Nemo Relay Native Conditional Middleware Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeconditionalmiddlewarecb.md): Native callback deciding whether a matching runtime registration is eligible. - [Type Alias Nemo Relay Native Emit Mark V2Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeemitmarkv2fn.md): Extended native mark-emission function introduced in ABI v4. - [Type Alias Nemo Relay Native Event Sanitize Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeeventsanitizecb.md): Native event observability-field sanitizer callback. - [Type Alias Nemo Relay Native Event Subscriber Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeeventsubscribercb.md): Native event subscriber callback. - [Type Alias Nemo Relay Native Free Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativefreefn.md): Optional destructor for user data captured by native callbacks. - [Type Alias Nemo Relay Native GetRuntime Diagnostics Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativegetruntimediagnosticsfn.md): Reads the active host runtime-diagnostics snapshot as canonical JSON. - [Type Alias Nemo Relay Native LlmConditional Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmconditionalcb.md): Native LLM conditional-execution callback. - [Type Alias Nemo Relay Native LlmExecution Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmexecutioncb.md): Native LLM execution intercept callback. - [Type Alias Nemo Relay Native LlmNext Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmnextfn.md): Runtime-provided continuation for LLM execution intercepts. - [Type Alias Nemo Relay Native LlmRequest Intercept Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmrequestinterceptcb.md): Native LLM request intercept callback. - [Type Alias Nemo Relay Native LlmSanitize Request Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmsanitizerequestcb.md): Native LLM request sanitizer callback. Return a successful null output to omit the observability payload and annotation. `request_json` is borrowed, but may be written directly to `out_request_json` as a pass-through; the host releases an aliased input/output once. Any other non-null output must be host-allocated and transfers ownership to the host. - [Type Alias Nemo Relay Native LlmSanitize Response Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmsanitizeresponsecb.md): Native LLM response sanitizer callback. Return a successful null output to omit the observability payload and annotation. `payload_json` is borrowed, but may be written directly to `out_json` as a pass-through; the host releases an aliased input/output once. Any other non-null output must be host-allocated and transfers ownership to the host. - [Type Alias Nemo Relay Native LlmStream Cancel Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmstreamcancelfn.md): Optional native stream cancellation callback. - [Type Alias Nemo Relay Native LlmStream Drop Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmstreamdropfn.md): Optional native stream destructor callback. - [Type Alias Nemo Relay Native LlmStream Execution Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmstreamexecutioncb.md): Native LLM stream execution intercept callback. - [Type Alias Nemo Relay Native LlmStream Next Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmstreamnextfn.md): Runtime-provided continuation for LLM stream execution intercepts. - [Type Alias Nemo Relay Native LlmStream Poll Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativellmstreampollfn.md): Native stream poll callback. - [Type Alias Nemo Relay Native Plugin Drop Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativeplugindropfn.md): Native plugin drop callback. - [Type Alias Nemo Relay Native Plugin Entry](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativepluginentry.md): Native entry symbol type loaded by the host. - [Type Alias Nemo Relay Native Plugin Register Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativepluginregisterfn.md): Native plugin registration callback. - [Type Alias Nemo Relay Native Plugin Validate Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativepluginvalidatefn.md): Native plugin validation callback. - [Type Alias Nemo Relay Native Tool Conditional Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativetoolconditionalcb.md): Native tool conditional-execution callback. - [Type Alias Nemo Relay Native Tool Execution Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativetoolexecutioncb.md): Native tool execution intercept callback. - [Type Alias Nemo Relay Native Tool Json Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativetooljsoncb.md): Native JSON transform callback for tool request/response sanitizers and tool request intercepts. - [Type Alias Nemo Relay Native Tool Next Fn](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativetoolnextfn.md): Runtime-provided continuation for tool execution intercepts. - [Type Alias Nemo Relay Native With Scope Stack Cb](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-nemorelaynativewithscopestackcb.md): Native callback executed while a host scope stack is temporarily active. - [Type Alias Result](https://docs.nvidia.com/nemo/relay/v0.8.4/reference/api/rust-library-reference/nemo-relay-plugin/type-result.md): Result type used by the Rust native plugin SDK.