Struct Plugin Context
Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -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.
Registration context supplied to Plugin::register for one native component.
Use its registration methods to install component-owned callbacks and Self::runtime to obtain the host’s runtime capabilities.
Implementations
impl PluginContext<'_>
Referenced types: PluginContext
runtime
Referenced types: PluginRuntime
Clone the runtime capabilities available to this native component.
task_spawner
Referenced types: PluginTaskSpawner
Obtain a cloneable task spawner for use inside registered middleware.
spawn
Referenced types: Future, Send
Spawn background work whose scope, cancellation, and cleanup belong to this component.
register_subscriber
Referenced types: Fn, Event, Send, Sync, str, ()
Register a synchronous event subscriber owned by this component.
register_conditional_middleware_guardrail
Referenced types: str, BTreeSet, RuntimeRegistrationKind, (), Fn, Option, String, Send, Sync
Register a synchronous gate that can disable selected middleware registrations.
impl PluginContext<'_>
Referenced types: PluginContext
register_event_metadata_injector
Referenced types: str, i32, (), Fn, Arc, Event, Send, Sync, Future, BTreeMap, String, Json
Register an async callback that adds metadata to emitted events.
register_mark_sanitize_guardrail
Referenced types: str, i32, (), Fn, Arc, Event, EventSanitizeFields, Send, Sync, Future
Register an async sanitizer for observable fields on mark events.
register_scope_sanitize_start_guardrail
Referenced types: str, i32, (), Fn, Arc, Event, EventSanitizeFields, Send, Sync, Future
Register an async sanitizer for observable fields on scope-start events.
register_scope_sanitize_end_guardrail
Referenced types: str, i32, (), Fn, Arc, Event, EventSanitizeFields, Send, Sync, Future
Register an async sanitizer for observable fields on scope-end events.
register_tool_sanitize_request_guardrail
Referenced types: str, i32, (), Fn, String, Json, Send, Sync, Future
Register an async sanitizer for tool request data recorded in events.
register_tool_sanitize_response_guardrail
Referenced types: str, i32, (), Fn, String, Json, Send, Sync, Future
Register an async sanitizer for tool response data recorded in events.
register_tool_conditional_execution_guardrail
Referenced types: str, i32, (), Fn, String, Json, Send, Sync, Future, Option
Register an async guardrail that allows or blocks a tool call.
register_tool_request_intercept
Referenced types: str, i32, bool, (), Fn, String, Json, Send, Sync, Future
Register an async intercept that can rewrite a tool’s execution arguments.
register_tool_execution_intercept
Referenced types: str, i32, (), Fn, ToolExecutionContext, ToolNext, Send, Sync, Future, ToolExecutionInterceptOutcome
Register an async tool execution wrapper with repeatable downstream continuations.
register_llm_conditional_execution_guardrail
Referenced types: str, i32, (), Fn, LlmRequest, Send, Sync, Future, Option, String
Register an async guardrail that allows or blocks an LLM call.
register_llm_request_intercept
Referenced types: str, i32, bool, (), Fn, String, LlmRequest, Option, AnnotatedLlmRequest, Send, Sync, Future, LlmRequestInterceptOutcome
Register an async intercept that can rewrite or complete an LLM request.
register_llm_sanitize_request_guardrail
Referenced types: str, i32, (), Fn, LlmRequest, LlmSanitizeRequestContext, Send, Sync, Future, Option
Register an async sanitizer for observable LLM request data with its request codec context.
register_llm_sanitize_response_guardrail
Referenced types: str, i32, (), Fn, Json, LlmSanitizeResponseContext, Send, Sync, Future, Option
Register an async sanitizer for observable LLM responses with their response codec context.
register_llm_execution_intercept
Referenced types: str, i32, (), Fn, String, LlmRequest, LlmExecutionContext, LlmNext, Send, Sync, Future, Json
Register an async LLM execution wrapper with live codec capabilities and downstream continuation.
register_llm_stream_execution_intercept
Referenced types: str, i32, (), Fn, String, LlmRequest, LlmExecutionContext, LlmStreamNext, Send, Sync, Future, LlmJsonAsyncStream
Register an async LLM stream wrapper whose streams close with the owning component.
impl PluginContext<'_>
Referenced types: PluginContext
register_synchronous_callback
Referenced types: str, i32, bool, (), Fn, Option, Send, Sync
Register a synchronous callback using only checked ABI invocation values. The Rust callback and its captured state remain in the originating SDK. Subscribers run inline; synchronous middleware uses blocking offload.
impl PluginContext<'_>
Referenced types: PluginContext
register_synchronous_stream_callback
Referenced types: str, i32, (), Fn, Send, Sync
Register a synchronous stream factory returning a checked stream descriptor. Offload construction; poll returned stream futures under component scope and runtime context.