> 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 Runtime

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

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 PluginRuntime { /* private fields */ }
```

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

## Implementations

### `impl PluginRuntime`

<pre />

#### `emit_mark`

<pre />

Emits a mark event through the host runtime.

#### `create_scope_stack`

<pre />

Creates an isolated host-owned scope stack.

#### `drop_scope_stack`

<pre />

Drops an isolated host-owned scope stack.

#### `with_scope_stack`

<pre />

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`](/reference/api/rust-library-reference/nemo-relay-worker/struct-pluginruntime). The previous worker invocation scope is restored after the future completes.

#### `push_scope`

<pre />

Pushes a scope through the host runtime.

#### `pop_scope`

<pre />

Pops a scope through the host runtime.

## Trait Implementations

### `impl Clone for PluginRuntime`

<pre />

#### `clone`

<pre />

#### `clone_from`

<pre />