pub struct ToolCallCache { /* private fields */ }Expand description
Intelligent tool call result cache
Implementations§
Source§impl ToolCallCache
impl ToolCallCache
pub fn new() -> Self
pub fn with_ttl(self, ttl: Duration) -> Self
pub fn with_max_size(self, size: usize) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
pub fn get(&self, key: &CacheKey) -> Option<Value>
pub fn insert(&self, key: CacheKey, result: Value, ttl: Option<Duration>)
pub fn insert_with_key( &self, tool_name: String, arguments: Value, result: Value, )
pub fn clear(&self)
pub fn invalidate_tool(&self, tool_name: &str)
pub fn stats(&self) -> CacheStats
Trait Implementations§
Source§impl Clone for ToolCallCache
impl Clone for ToolCallCache
Source§fn clone(&self) -> ToolCallCache
fn clone(&self) -> ToolCallCache
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 moreAuto Trait Implementations§
impl Freeze for ToolCallCache
impl !RefUnwindSafe for ToolCallCache
impl Send for ToolCallCache
impl Sync for ToolCallCache
impl Unpin for ToolCallCache
impl UnsafeUnpin for ToolCallCache
impl UnwindSafe for ToolCallCache
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