Struct Plugin Registration Context

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.

1pub struct PluginRegistrationContext { /* private fields */ }

Context provided to plugin handlers during runtime registration.

Each register_* call both installs the middleware/subscriber into the NeMo Relay runtime and records the inverse deregistration closure so the host can roll back partial setup on failure.

Implementations

impl PluginRegistrationContext

impl PluginRegistrationContext

new

pub fn new() -> Self

Creates an empty plugin registration context.

with_namespace

pub fn with_namespace(namespace: impl Into<String>) -> Self

Creates a plugin registration context that namespaces all registration names.

qualify_name

pub fn qualify_name(&self, name: &str) -> String

Returns the runtime-qualified name for a plugin-local registration.

Plugin handlers should pass stable component-local names such as "tool" or "subscriber". The host applies the namespace so users do not have to provide component instance ids.

register_subscriber

pub fn register_subscriber(
    &mut self,
    name: &str,
    callback: EventSubscriberFn,
) -> Result<()>

Registers an event subscriber and records its rollback closure.

register_llm_request_intercept

pub fn register_llm_request_intercept(
    &mut self,
    name: &str,
    priority: i32,
    break_chain: bool,
    callback: LlmRequestInterceptFn,
) -> Result<()>

Registers an LLM request intercept and records its rollback closure.

register_tool_sanitize_request_guardrail

pub fn register_tool_sanitize_request_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: ToolSanitizeFn,
) -> Result<()>

Registers a tool sanitize-request guardrail and records its rollback closure.

register_tool_sanitize_response_guardrail

pub fn register_tool_sanitize_response_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: ToolSanitizeFn,
) -> Result<()>

Registers a tool sanitize-response guardrail and records its rollback closure.

register_tool_conditional_execution_guardrail

pub fn register_tool_conditional_execution_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: ToolConditionalFn,
) -> Result<()>

Registers a tool conditional-execution guardrail and records its rollback closure.

register_llm_sanitize_request_guardrail

pub fn register_llm_sanitize_request_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: LlmSanitizeRequestFn,
) -> Result<()>

Registers an LLM sanitize-request guardrail and records its rollback closure.

register_llm_sanitize_response_guardrail

pub fn register_llm_sanitize_response_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: LlmSanitizeResponseFn,
) -> Result<()>

Registers an LLM sanitize-response guardrail and records its rollback closure.

register_llm_conditional_execution_guardrail

pub fn register_llm_conditional_execution_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: LlmConditionalFn,
) -> Result<()>

Registers an LLM conditional-execution guardrail and records its rollback closure.

register_llm_execution_intercept

pub fn register_llm_execution_intercept(
    &mut self,
    name: &str,
    priority: i32,
    callback: LlmExecutionFn,
) -> Result<()>

Registers an LLM execution intercept and records its rollback closure.

register_llm_stream_execution_intercept

pub fn register_llm_stream_execution_intercept(
    &mut self,
    name: &str,
    priority: i32,
    callback: LlmStreamExecutionFn,
) -> Result<()>

Registers an LLM stream execution intercept and records its rollback closure.

register_tool_request_intercept

pub fn register_tool_request_intercept(
    &mut self,
    name: &str,
    priority: i32,
    break_chain: bool,
    callback: ToolInterceptFn,
) -> Result<()>

Registers a tool request intercept and records its rollback closure.

register_tool_execution_intercept

pub fn register_tool_execution_intercept(
    &mut self,
    name: &str,
    priority: i32,
    callback: ToolExecutionFn,
) -> Result<()>

Registers a tool execution intercept and records its rollback closure.

add_registration

pub fn add_registration(&mut self, registration: PluginRegistration)

Adds a prebuilt registration to the context.

extend_registrations

pub fn extend_registrations(&mut self, registrations: Vec<PluginRegistration>)

Extends the context with prebuilt registrations.

into_registrations

pub fn into_registrations(self) -> Vec<PluginRegistration>

Consumes the context and returns the recorded registrations.

Trait Implementations

impl Default for PluginRegistrationContext

impl Default for PluginRegistrationContext

default

fn default() -> PluginRegistrationContext