Skip to navigation

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.

pub struct PluginRuntime { /* private fields */ }

Cloneable handle for calling the Relay host runtime from worker callbacks.

Implementations

impl PluginRuntime

impl PluginRuntime

Referenced types: PluginRuntime

diagnostics

pub async fn diagnostics(&self) -> &WorkerDiagnostics

Referenced types: WorkerDiagnostics

Negotiate once per activation. Disabled/unsupported facades skip lazy diagnostic factories and leave execution and operational logging intact.

log

pub async fn log(
&self,
level: PluginLogLevel,
target: &str,
message: &str,
fields: Option<&Map<String, Json>>,
) -> Result<()>

Referenced types: PluginLogLevel, str, Option, Map, String, Json, Result, ()

Emits one operational log record through the Relay host’s configured sinks.

The host authenticates the activation and applies its own log-level filter. target identifies the plugin subsystem; pass an empty string to use the plugin’s default target.

trace

pub async fn trace(
&self,
target: &str,
message: &str,
fields: Option<&Map<String, Json>>,
) -> Result<()>

Referenced types: str, Option, Map, String, Json, Result, ()

Emits an info-level operational log record through the Relay host.

debug

pub async fn debug(
&self,
target: &str,
message: &str,
fields: Option<&Map<String, Json>>,
) -> Result<()>

Referenced types: str, Option, Map, String, Json, Result, ()

Emits a debug-level operational log record through the Relay host.

info

pub async fn info(
&self,
target: &str,
message: &str,
fields: Option<&Map<String, Json>>,
) -> Result<()>

Referenced types: str, Option, Map, String, Json, Result, ()

Emits an info-level operational log record through the Relay host.

warn

pub async fn warn(
&self,
target: &str,
message: &str,
fields: Option<&Map<String, Json>>,
) -> Result<()>

Referenced types: str, Option, Map, String, Json, Result, ()

Emits a warn-level operational log record through the Relay host.

error

pub async fn error(
&self,
target: &str,
message: &str,
fields: Option<&Map<String, Json>>,
) -> Result<()>

Referenced types: str, Option, Map, String, Json, Result, ()

Emits an error-level operational log record through the Relay host.

list_runtime_registrations

pub async fn list_runtime_registrations(
&self,
kinds: Option<BTreeSet<RuntimeRegistrationKind>>,
) -> Result<Vec<RuntimeRegistrationIdentity>>

Referenced types: Option, BTreeSet, RuntimeRegistrationKind, Result, Vec, RuntimeRegistrationIdentity

List global runtime registrations, optionally filtered by kind.

register_conditional_middleware_guardrail

pub async fn register_conditional_middleware_guardrail<F, Fut>(
&self,
name: &str,
kinds: BTreeSet<RuntimeRegistrationKind>,
registration_name: &str,
callback: F,
) -> Result<ConditionalMiddlewareGuardrailHandle>where
F: Fn(BTreeSet<RuntimeRegistrationKind>, String) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Option<String>>> + Send + 'static,

Referenced types: str, BTreeSet, RuntimeRegistrationKind, Result, ConditionalMiddlewareGuardrailHandle, Fn, String, Send, Sync, Future, Option

Register a callback-based gate owned by this worker activation.

deregister_conditional_middleware_guardrail

pub async fn deregister_conditional_middleware_guardrail(
&self,
handle: &ConditionalMiddlewareGuardrailHandle,
) -> Result<bool>

Referenced types: ConditionalMiddlewareGuardrailHandle, Result, bool

Deregister a callback-based gate owned by this worker activation.

emit_mark

pub async fn emit_mark(
&self,
name: &str,
data: Option<Json>,
metadata: Option<Json>,
) -> Result<()>

Referenced types: str, Option, Json, Result, ()

Emits a mark event through the host runtime.

emit_mark_with_options

pub async fn emit_mark_with_options(
&self,
name: &str,
data: Option<Json>,
metadata: Option<Json>,
options: EmitMarkOptions,
) -> Result<()>

Referenced types: str, Option, Json, EmitMarkOptions, Result, ()

Emits a mark event through the host runtime with optional schema and severity fields.

emit_mark_with_options_and_category

pub async fn emit_mark_with_options_and_category(
&self,
name: &str,
data: Option<Json>,
metadata: Option<Json>,
options: EmitMarkOptions,
category: EventCategory,
) -> Result<()>

Referenced types: str, Option, Json, EmitMarkOptions, EventCategory, Result, ()

Emits a mark event through the host runtime with optional schema, severity, and category.

current_scope_stack_snapshot

pub async fn current_scope_stack_snapshot(
&self,
) -> Result<Option<ScopeStackSnapshot>>

Referenced types: Result, Option, ScopeStackSnapshot

Read owned root-to-top scope identities from the exact current binding. Returns None without a binding and an error if the host cannot read the binding or it has expired. Reads the live scope stack on each call.

inspect_llm_content

pub async fn inspect_llm_content(
&self,
source: ContentSource<'_>,
selection: ContentSelection,
) -> Result<Option<ContentSnapshot>>

Referenced types: ContentSource, ContentSelection, Result, Option, ContentSnapshot

Inspect supplied normalized content through the host’s shared Rust projection.

One RPC returns an independent snapshot. Older hosts return an explicit unsupported error; this method never falls back to a worker-local extraction implementation.

runtime_diagnostics

pub async fn runtime_diagnostics(&self) -> Result<RuntimeDiagnostics>

Referenced types: Result, RuntimeDiagnostics

Return a bounded snapshot of active host runtime diagnostics.

emit_metric

pub async fn emit_metric(
&self,
name: &str,
measurements: Vec<MetricMeasurement>,
metadata: Option<Json>,
) -> Result<()>

Referenced types: str, Vec, MetricMeasurement, Option, Json, Result, ()

Emits a validated Relay metric-measurement mark through the host runtime.

emit_metric_with_category

pub async fn emit_metric_with_category(
&self,
name: &str,
measurements: Vec<MetricMeasurement>,
metadata: Option<Json>,
category: EventCategory,
) -> Result<()>

Referenced types: str, Vec, MetricMeasurement, Option, Json, EventCategory, Result, ()

Emits a validated Relay metric-measurement mark with an event category.

create_scope_stack

pub async fn create_scope_stack(&self) -> Result<String>

Referenced types: Result, String

Creates an isolated host-owned scope stack.

drop_scope_stack

pub async fn drop_scope_stack(&self, scope_stack_id: &str) -> Result<()>

Referenced types: str, Result, ()

Drops an isolated host-owned scope stack.

with_scope_stack

pub async fn with_scope_stack<F, Fut, T>(&self, scope_stack_id: &str, f: F) -> Twhere
F: FnOnce() -> Fut,
Fut: Future<Output = T>,

Referenced types: str, FnOnce, Future

Runs an async operation with runtime calls bound to a specific host-owned scope stack.

This is useful for isolated stacks created with Self::create_scope_stack. The previous worker invocation scope is restored after the future completes.

push_scope

pub async fn push_scope(
&self,
scope_stack_id: Option<&str>,
name: &str,
scope_type: ScopeType,
data: Option<Json>,
metadata: Option<Json>,
input: Option<Json>,
) -> Result<String>

Referenced types: Option, str, ScopeType, Json, Result, String

Pushes a scope through the host runtime.

push_scope_at

pub async fn push_scope_at(
&self,
scope_stack_id: Option<&str>,
name: &str,
scope_type: ScopeType,
data: Option<Json>,
metadata: Option<Json>,
input: Option<Json>,
started_at: SystemTime,
) -> Result<String>

Referenced types: Option, str, ScopeType, Json, SystemTime, Result, String

Pushes a scope through the host runtime using an explicit start time.

pop_scope

pub async fn pop_scope(
&self,
scope_handle_id: &str,
output: Option<Json>,
metadata: Option<Json>,
) -> Result<()>

Referenced types: str, Option, Json, Result, ()

Pops a scope through the host runtime.

pop_scope_at

pub async fn pop_scope_at(
&self,
scope_handle_id: &str,
output: Option<Json>,
metadata: Option<Json>,
ended_at: SystemTime,
) -> Result<()>

Referenced types: str, Option, Json, SystemTime, Result, ()

Pops a scope through the host runtime using an explicit end time.

Trait Implementations

impl Clone for PluginRuntime

impl Clone for PluginRuntime

Referenced types: Clone, PluginRuntime

clone

fn clone(&self) -> PluginRuntime

Referenced types: clone, PluginRuntime

clone_from

fn clone_from(&mut self, source: &Self)

Referenced types: clone_from