Struct Plugin Runtime
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.
Cloneable runtime capabilities supplied by the host to a native plugin.
Access scopes, emit telemetry, and inspect runtime state without depending on the runtime implementation. Obtain it from PluginContext::runtime.
Implementations
impl PluginRuntime
Referenced types: PluginRuntime
diagnostics
Referenced types: Diagnostics
Access diagnostic submission and authorized reads for this plugin.
current_scope_stack_snapshot
Referenced types: Option, ScopeStackSnapshot
Capture the current scope stack, or return None when no stack is active.
list_runtime_registrations
Referenced types: Option, BTreeSet, RuntimeRegistrationKind, Vec, RuntimeRegistrationIdentity
List active runtime registrations, optionally restricted to the supplied kinds.
scope_stack_active
Referenced types: bool
Return whether a scope stack is active; return false if the host lookup fails.
current_scope
Referenced types: ScopeHandle
Get the current scope handle or fail if the host reports no current scope.
push_scope
Referenced types: str, ScopeType, Option, Json, ScopeHandle
Push a scope using the default parent, attributes, and start time.
push_scope_with_options
Referenced types: str, ScopeType, Option, Json, ScopeOptions, ScopeHandle
Push a scope with an explicit parent, behavior flags, or start time.
pop_scope
Referenced types: ScopeHandle, Option, Json, ()
Close a scope with optional output and final metadata.
scope
Referenced types: str, ScopeType, Option, Json, ScopeGuard
Push a scope and return a guard that closes it when dropped.
scope_with_options
Referenced types: str, ScopeType, Option, Json, ScopeOptions, ScopeGuard
Open a scope guard with an explicit parent, behavior flags, or start time.
scope_at
Referenced types: str, ScopeType, Option, Json, SystemTime, ScopeGuard
Open a scope guard with an explicit start time.
emit_mark
Referenced types: str, Option, Json, ()
Emit a mark with optional data and metadata in the current scope.
emit_mark_with_options
Referenced types: str, Option, Json, DataSchema, LogSeverity, ()
Emit a mark in the current scope with an optional schema and severity.
emit_mark_with_context
Referenced types: str, Option, Json, EmitMarkOptions, ()
Emit a mark with an explicit parent, timestamp, schema, or severity.
emit_metric
Referenced types: str, Vec, MetricMeasurement, Option, Json, ()
Validate metric measurements and emit them using Relay’s reserved metric schema.
runtime_diagnostics
Referenced types: RuntimeDiagnostics
Read the runtime diagnostic report exposed by the host.
estimate_cost_for_provider
Referenced types: Option, str, Usage, CostEstimate
Estimate cost with the host’s active model pricing catalog.
Returns Ok(None) when the catalog has no pricing for the model. Hosts older than this operation return an error, which callers should treat as an unknown cost.
response_cost_for_provider
Referenced types: AnnotatedLlmResponse, Option, str, CostEstimate
Price a normalized response with the host’s full pricing rules.
Returns the response’s reported cost when present; otherwise the host’s estimate for its model and usage, or Ok(None) when unknown. Hosts older than this operation return an error, which callers should treat as an unknown cost.
log
Referenced types: PluginLogLevel, str, Option, Json, ()
Send a process log record with optional structured fields through the host runtime capability.
create_scope_stack
Referenced types: ScopeStack
Create an isolated host-owned scope stack whose handle releases it when dropped.
capture_scope_stack_thread
Referenced types: ScopeStackBinding
Capture this thread’s scope binding so it can be restored later.
bind_scope_stack_thread
Referenced types: ScopeStack, ThreadScopeStackGuard
Install an isolated stack until the returned guard restores the previous thread binding.
register_conditional_middleware_guardrail
Referenced types: str, BTreeSet, RuntimeRegistrationKind, ConditionalMiddlewareGuardrailHandle, Fn, Option, String, Send, Sync
Register a revocable synchronous gate scoped to this component’s lifetime.
deregister_conditional_middleware_guardrail
Referenced types: ConditionalMiddlewareGuardrailHandle, bool
Remove the conditional middleware guardrail identified by its registration token.
impl PluginRuntime
Referenced types: PluginRuntime
trace
Referenced types: str, Option, Json, ()
Emit a trace plugin log record through the host.
impl PluginRuntime
Referenced types: PluginRuntime
debug
Referenced types: str, Option, Json, ()
Emit a debug plugin log record through the host.
impl PluginRuntime
Referenced types: PluginRuntime
info
Referenced types: str, Option, Json, ()
Emit a info plugin log record through the host.
impl PluginRuntime
Referenced types: PluginRuntime
warn
Referenced types: str, Option, Json, ()
Emit a warn plugin log record through the host.
impl PluginRuntime
Referenced types: PluginRuntime
error
Referenced types: str, Option, Json, ()
Emit a error plugin log record through the host.
Trait Implementations
impl Clone for PluginRuntime
Referenced types: Clone, PluginRuntime
clone
Referenced types: clone, PluginRuntime
clone_from
Referenced types: clone_from