pub struct AdvancedToolAdmin { /* private fields */ }Implementations§
Source§impl AdvancedToolAdmin
impl AdvancedToolAdmin
Sourcepub async fn apply_state(&self, state: ToolState) -> Result<u64>
pub async fn apply_state(&self, state: ToolState) -> Result<u64>
Replace the entire tool-state snapshot.
This is a generation-checked escape hatch for hosts that intentionally
edit the full snapshot. Prefer ToolAdmin availability methods for
ordinary tool policy changes.
Sourcepub async fn restore_state(&self, state: ToolState) -> Result<ToolRestoreReport>
pub async fn restore_state(&self, state: ToolState) -> Result<ToolRestoreReport>
Restore a persisted tool-state snapshot, adopting its generation.
Use this when re-applying a snapshot read from durable storage (session
resume), not an edited delta: it reconstructs the exact persisted surface
idempotently rather than requiring the snapshot to match the current
generation. A cold resume of a session whose surface reached generation
≥ 2 needs this — apply_state would reject it.
Persisted tools whose source is not currently registered (e.g. a
detached MCP server) do not fail the restore: they are kept as orphans,
forced Off, listed in the returned ToolRestoreReport, and rebind
automatically when a source re-advertises the same tool.
Trait Implementations§
Source§impl Clone for AdvancedToolAdmin
impl Clone for AdvancedToolAdmin
Source§fn clone(&self) -> AdvancedToolAdmin
fn clone(&self) -> AdvancedToolAdmin
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more