> This page is for NeMo Relay, version v0.8.4.
> For other versions, use one of these documentation indexes:
> - Latest (v0.10.0) (default): https://docs.nvidia.com/nemo/relay/latest/llms.txt
> - dev: https://docs.nvidia.com/nemo/relay/dev/llms.txt
> - v0.10.0: https://docs.nvidia.com/nemo/relay/v0.10.0/llms.txt
> - v0.9.4: https://docs.nvidia.com/nemo/relay/v0.9.4/llms.txt
> - v0.8.4: https://docs.nvidia.com/nemo/relay/v0.8.4/llms.txt
> - v0.7.3: https://docs.nvidia.com/nemo/relay/v0.7.3/llms.txt
> - v0.6.0: https://docs.nvidia.com/nemo/relay/v0.6.0/llms.txt
> - v0.5.0: https://docs.nvidia.com/nemo/relay/v0.5.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Struct Plugin Registration Context

> Context provided to plugin handlers during runtime registration.

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`.

```rust
pub 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`

<pre />

#### `new`

<pre />

Creates an empty plugin registration context.

#### `with_namespace`

<pre />

Creates a plugin registration context that namespaces all registration names.

#### `with_child_namespace`

<pre />

Creates a child context that extends this context's namespace.

Child contexts preserve Relay-created plugin component qualification so their local namespace segments and registration names remain encoded as one effective component name.

#### `qualify_name`

<pre />

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`

<pre />

Registers an event subscriber and records its rollback closure.

#### `register_conditional_middleware_guardrail`

<pre />

Registers a global conditional middleware guardrail and records its rollback closure.

#### `register_event_metadata_injector`

<pre />

Registers an Event metadata injector and records its rollback closure.

#### `register_mark_sanitize_guardrail`

<pre />

Registers a mark event sanitizer and records its rollback closure.

#### `register_scope_sanitize_start_guardrail`

<pre />

Registers a scope-start event sanitizer and records its rollback closure.

#### `register_scope_sanitize_end_guardrail`

<pre />

Registers a scope-end event sanitizer and records its rollback closure.

#### `register_llm_request_intercept`

<pre />

Registers an LLM request intercept and records its rollback closure.

#### `register_tool_sanitize_request_guardrail`

<pre />

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

#### `register_tool_sanitize_response_guardrail`

<pre />

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

#### `register_tool_conditional_execution_guardrail`

<pre />

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

#### `register_llm_sanitize_request_guardrail`

<pre />

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

#### `register_llm_sanitize_response_guardrail`

<pre />

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

#### `register_llm_conditional_execution_guardrail`

<pre />

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

#### `register_llm_execution_intercept`

<pre />

Registers an LLM execution intercept and records its rollback closure.

#### `register_llm_stream_execution_intercept`

<pre />

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

#### `register_tool_request_intercept`

<pre />

Registers a tool request intercept and records its rollback closure.

#### `register_tool_execution_intercept`

<pre />

Registers a tool execution intercept and records its rollback closure.

#### `add_registration`

<pre />

Adds a prebuilt registration to the context.

#### `extend_registrations`

<pre />

Extends the context with prebuilt registrations.

#### `into_registrations`

<pre />

Consumes the context and returns the recorded registrations.

## Trait Implementations

### `impl Default for PluginRegistrationContext`

<pre />

#### `default`

<pre />