pub struct ToolRegistry { /* private fields */ }Implementations§
Source§impl ToolRegistry
impl ToolRegistry
pub fn from_tool_provider( provider: Arc<dyn ToolProvider>, ) -> Result<Self, ReconfigureError>
pub fn generation(&self) -> u64
pub fn export_state(&self) -> ToolState
pub fn apply_state(&self, next: ToolState) -> Result<u64, ReconfigureError>
Sourcepub fn restore_state(
&self,
snapshot: ToolState,
) -> Result<u64, ReconfigureError>
pub fn restore_state( &self, snapshot: ToolState, ) -> Result<u64, ReconfigureError>
Restore a persisted ToolState snapshot onto a freshly-built registry,
adopting the snapshot’s generation verbatim.
Unlike apply_state — which applies an incremental
delta expected at the current generation and bumps it by one — a
restore reconstructs the exact persisted state regardless of the fresh
registry’s base generation, and does not bump. This is idempotent: a
snapshot exported at generation G restores to generation G, so a
re-export round-trips. Cold rebuilds (the durable process worker, session
resume) restore a session whose tool surface reached generation G ≥ 2
onto a base registry at generation 1 — apply_state would reject that
(expected G, actual 1); restore_state adopts G. Entries are still
rebound to the live sources, so source identity is reconnected.
pub fn add_tool_provider( &self, provider: Arc<dyn ToolProvider>, ) -> Result<ToolSourceHandle, ReconfigureError>
pub fn remove_source( &self, handle: &ToolSourceHandle, ) -> Result<u64, ReconfigureError>
pub fn refresh_sources(&self) -> Result<u64, ReconfigureError>
Trait Implementations§
Source§impl Clone for ToolRegistry
impl Clone for ToolRegistry
Source§fn clone(&self) -> ToolRegistry
fn clone(&self) -> ToolRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more