pub struct LocalKnowledgeStore { /* private fields */ }Expand description
Deterministic in-memory implementation of KnowledgeStore.
Implementations§
Source§impl LocalKnowledgeStore
impl LocalKnowledgeStore
Sourcepub fn all(&self) -> Vec<KnowledgeObjectV1>
pub fn all(&self) -> Vec<KnowledgeObjectV1>
Return all objects in stable object-id order.
Sourcepub fn values(&self) -> impl Iterator<Item = &KnowledgeObjectV1>
pub fn values(&self) -> impl Iterator<Item = &KnowledgeObjectV1>
Borrow all objects in stable object-id order.
Sourcepub fn get_ref(&self, object_id: &str) -> Option<&KnowledgeObjectV1>
pub fn get_ref(&self, object_id: &str) -> Option<&KnowledgeObjectV1>
Fetch an object without cloning it.
Source§impl LocalKnowledgeStore
impl LocalKnowledgeStore
Sourcepub fn retrieve_for_task_with_result(
&self,
_task_id: &str,
budget: usize,
policy: &RetrievalPolicy,
) -> RetrievalResult
pub fn retrieve_for_task_with_result( &self, _task_id: &str, budget: usize, policy: &RetrievalPolicy, ) -> RetrievalResult
Retrieve with accounting details from the local reference store.
Sourcepub fn snapshot_for_task(
&self,
task_id: &str,
budget: usize,
policy: &RetrievalPolicy,
policy_version: &str,
) -> KnowledgeSnapshot
pub fn snapshot_for_task( &self, task_id: &str, budget: usize, policy: &RetrievalPolicy, policy_version: &str, ) -> KnowledgeSnapshot
Produce a receipt-ready proof of the objects selected for a task.
Trait Implementations§
Source§impl Clone for LocalKnowledgeStore
impl Clone for LocalKnowledgeStore
Source§impl Debug for LocalKnowledgeStore
impl Debug for LocalKnowledgeStore
Source§impl Default for LocalKnowledgeStore
impl Default for LocalKnowledgeStore
Source§impl KnowledgeRetriever for LocalKnowledgeStore
impl KnowledgeRetriever for LocalKnowledgeStore
Source§fn retrieve_for_task(
&self,
task_id: &str,
budget: usize,
policy: &RetrievalPolicy,
) -> Vec<KnowledgeObjectV1>
fn retrieve_for_task( &self, task_id: &str, budget: usize, policy: &RetrievalPolicy, ) -> Vec<KnowledgeObjectV1>
Retrieve at most
budget valid objects for a task.Source§impl KnowledgeStore for LocalKnowledgeStore
impl KnowledgeStore for LocalKnowledgeStore
Source§fn get(&self, object_id: &str) -> Option<KnowledgeObjectV1>
fn get(&self, object_id: &str) -> Option<KnowledgeObjectV1>
Fetch a content-addressed object by its stable object id.
Source§fn put(&mut self, object: KnowledgeObjectV1) -> Result<(), KnowledgeStoreError>
fn put(&mut self, object: KnowledgeObjectV1) -> Result<(), KnowledgeStoreError>
Insert or replace an object.
Source§fn query(&self, query: &KnowledgeQuery) -> Vec<KnowledgeObjectV1>
fn query(&self, query: &KnowledgeQuery) -> Vec<KnowledgeObjectV1>
Return objects matching every supplied filter.
Source§fn supersede(
&mut self,
old_object_id: &str,
replacement: KnowledgeObjectV1,
) -> Result<(), KnowledgeStoreError>
fn supersede( &mut self, old_object_id: &str, replacement: KnowledgeObjectV1, ) -> Result<(), KnowledgeStoreError>
Store a replacement and link the old object to it through
ValidityWindow::superseded_by.Auto Trait Implementations§
impl Forget for LocalKnowledgeStore
impl Freeze for LocalKnowledgeStore
impl Move for LocalKnowledgeStore
impl RefUnwindSafe for LocalKnowledgeStore
impl Send for LocalKnowledgeStore
impl Sync for LocalKnowledgeStore
impl Unpin for LocalKnowledgeStore
impl UnsafeUnpin for LocalKnowledgeStore
impl UnwindSafe for LocalKnowledgeStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more