pub struct InMemoryStorage { /* private fields */ }Expand description
Memories held in memory. The second implementation, and what a test that is about recall rather than about files should use.
Implementations§
Source§impl InMemoryStorage
impl InMemoryStorage
pub fn new(memories: Vec<DurableMemory>) -> Self
Trait Implementations§
Source§impl Default for InMemoryStorage
impl Default for InMemoryStorage
Source§impl MemoryStorage for InMemoryStorage
impl MemoryStorage for InMemoryStorage
Source§fn load_all(&self) -> Vec<DurableMemory>
fn load_all(&self) -> Vec<DurableMemory>
Every memory, most recently seen first.
Source§fn search(&self, query: &str) -> Vec<DurableMemory>
fn search(&self, query: &str) -> Vec<DurableMemory>
Memories matching
query, however this backend matches. The shipped
implementation is a substring scan; a backend with an index is
expected to do better, and nothing depends on the ranking.Source§fn persist_batch(
&self,
memories: Vec<DurableMemory>,
) -> Result<usize, MemoryError>
fn persist_batch( &self, memories: Vec<DurableMemory>, ) -> Result<usize, MemoryError>
Write these, returning how many landed.
Auto Trait Implementations§
impl !Freeze for InMemoryStorage
impl Forget for InMemoryStorage
impl Move for InMemoryStorage
impl RefUnwindSafe for InMemoryStorage
impl Send for InMemoryStorage
impl Sync for InMemoryStorage
impl Unpin for InMemoryStorage
impl UnsafeUnpin for InMemoryStorage
impl UnwindSafe for InMemoryStorage
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