pub struct IdempotencyRegistry(/* private fields */);Expand description
Shared registry that deduplicates mutating file-system tool calls within a run.
Create one per agent run and attach it to ToolContext via
ToolContext::with_idempotency_registry. All clones of the ToolContext
share the same underlying map so that idempotency is enforced across the
entire run regardless of how many times the context is cloned.
Implementations§
Source§impl IdempotencyRegistry
impl IdempotencyRegistry
Sourcepub fn new() -> IdempotencyRegistry
pub fn new() -> IdempotencyRegistry
Create a new, empty registry.
Sourcepub fn get(&self, key: &str) -> Option<IdempotencyRecord>
pub fn get(&self, key: &str) -> Option<IdempotencyRecord>
Return the cached result for key, or None if not yet executed.
Trait Implementations§
Source§impl Clone for IdempotencyRegistry
impl Clone for IdempotencyRegistry
Source§fn clone(&self) -> IdempotencyRegistry
fn clone(&self) -> IdempotencyRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IdempotencyRegistry
impl Debug for IdempotencyRegistry
Source§impl Default for IdempotencyRegistry
impl Default for IdempotencyRegistry
Source§fn default() -> IdempotencyRegistry
fn default() -> IdempotencyRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IdempotencyRegistry
impl RefUnwindSafe for IdempotencyRegistry
impl Send for IdempotencyRegistry
impl Sync for IdempotencyRegistry
impl Unpin for IdempotencyRegistry
impl UnsafeUnpin for IdempotencyRegistry
impl UnwindSafe for IdempotencyRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more