pub struct SubstringRetriever;Expand description
Matches on substrings and spends nothing.
The second implementation, and the one a test wants: recall that is a pure function of the store is recall a test can assert on, where the model-based default is a judgement that may reasonably differ between runs.
Trait Implementations§
Source§impl MemoryRetriever for SubstringRetriever
impl MemoryRetriever for SubstringRetriever
Source§fn retrieve<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
storage: &'life1 dyn MemoryStorage,
_model: &'life2 dyn Model,
request: &'life3 RetrievalRequest,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn retrieve<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
storage: &'life1 dyn MemoryStorage,
_model: &'life2 dyn Model,
request: &'life3 RetrievalRequest,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Returns memory names, best first. Names rather than whole memories
because the caller re-reads them from storage anyway, and a retriever
backed by an index has no reason to carry the bodies around.
Auto Trait Implementations§
impl Forget for SubstringRetriever
impl Freeze for SubstringRetriever
impl Move for SubstringRetriever
impl RefUnwindSafe for SubstringRetriever
impl Send for SubstringRetriever
impl Sync for SubstringRetriever
impl Unpin for SubstringRetriever
impl UnsafeUnpin for SubstringRetriever
impl UnwindSafe for SubstringRetriever
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