pub struct InMemoryMemory { /* private fields */ }Expand description
Default in-process memory backend.
Implementations§
Source§impl InMemoryMemory
impl InMemoryMemory
Sourcepub fn with_max_messages(max_messages: usize) -> Self
pub fn with_max_messages(max_messages: usize) -> Self
Creates an in-memory backend capped to the most recent messages.
Trait Implementations§
Source§impl Clone for InMemoryMemory
impl Clone for InMemoryMemory
Source§fn clone(&self) -> InMemoryMemory
fn clone(&self) -> InMemoryMemory
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 InMemoryMemory
impl Debug for InMemoryMemory
Source§impl Default for InMemoryMemory
impl Default for InMemoryMemory
Source§fn default() -> InMemoryMemory
fn default() -> InMemoryMemory
Returns the “default value” for a type. Read more
Source§impl Memory for InMemoryMemory
impl Memory for InMemoryMemory
Source§fn store<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_key: &'life1 str,
value: Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_key: &'life1 str,
value: Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stores a message under a logical key.
Source§fn retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves relevant messages for a query.
Source§impl SearchableMemory for InMemoryMemory
impl SearchableMemory for InMemoryMemory
Auto Trait Implementations§
impl Freeze for InMemoryMemory
impl RefUnwindSafe for InMemoryMemory
impl Send for InMemoryMemory
impl Sync for InMemoryMemory
impl Unpin for InMemoryMemory
impl UnsafeUnpin for InMemoryMemory
impl UnwindSafe for InMemoryMemory
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