pub struct InMemory { /* private fields */ }Expand description
In-memory store backed by Arc<Mutex<Vec<(String, String)>>>.
Clone is cheap — clones share the same underlying storage.
Implementations§
Trait Implementations§
Source§impl Hook for InMemory
impl Hook for InMemory
Source§fn on_build_agent(&self, config: AgentConfig) -> AgentConfig
fn on_build_agent(&self, config: AgentConfig) -> AgentConfig
Source§fn on_register_tools(
&self,
registry: &mut ToolRegistry,
) -> impl Future<Output = ()> + Send
fn on_register_tools( &self, registry: &mut ToolRegistry, ) -> impl Future<Output = ()> + Send
Called by
Runtime::new() to register tools into the shared registry. Read moreSource§impl Memory for InMemory
impl Memory for InMemory
Source§fn set(
&self,
key: impl Into<String>,
value: impl Into<String>,
) -> Option<String>
fn set( &self, key: impl Into<String>, value: impl Into<String>, ) -> Option<String>
Set (upsert) a key-value pair. Returns the previous value if the key existed.
Source§fn remove(&self, key: &str) -> Option<String>
fn remove(&self, key: &str) -> Option<String>
Remove a key. Returns the removed value if it existed.
Source§fn store(
&self,
key: impl Into<String> + Send,
value: impl Into<String> + Send,
) -> impl Future<Output = Result<(), Error>> + Send
fn store( &self, key: impl Into<String> + Send, value: impl Into<String> + Send, ) -> impl Future<Output = Result<(), Error>> + Send
Store a key-value pair (async). Default delegates to
set.Auto Trait Implementations§
impl Freeze for InMemory
impl RefUnwindSafe for InMemory
impl Send for InMemory
impl Sync for InMemory
impl Unpin for InMemory
impl UnsafeUnpin for InMemory
impl UnwindSafe for InMemory
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