pub struct KnowledgeSnapshot {
pub actors: BTreeMap<PersonId, ActorKnowledge>,
pub records: BTreeMap<KnowledgeHolderRef, BTreeMap<KnowledgeRecordId, KnowledgeRecord>>,
}Fields§
§actors: BTreeMap<PersonId, ActorKnowledge>§records: BTreeMap<KnowledgeHolderRef, BTreeMap<KnowledgeRecordId, KnowledgeRecord>>Implementations§
Source§impl KnowledgeSnapshot
impl KnowledgeSnapshot
Sourcepub fn record_count_in_namespace(&self, namespace: &str) -> usize
pub fn record_count_in_namespace(&self, namespace: &str) -> usize
Counts all retained holder-relative records in one schema namespace.
pub fn for_actor(&self, actor: PersonId) -> Option<&ActorKnowledge>
pub fn for_holder( &self, holder: &KnowledgeHolderRef, ) -> Option<&BTreeMap<KnowledgeRecordId, KnowledgeRecord>>
Sourcepub fn query(
&self,
holder: KnowledgeHolderRef,
query: &KnowledgeQuery,
read_cut: KnowledgeReadCut,
) -> Result<KnowledgeQueryResult, KnowledgeQueryError>
pub fn query( &self, holder: KnowledgeHolderRef, query: &KnowledgeQuery, read_cut: KnowledgeReadCut, ) -> Result<KnowledgeQueryResult, KnowledgeQueryError>
Returns one deterministic holder-facing page at the supplied read cut.
§Errors
Returns the same validation errors as GenericKnowledgeLedger::query.
Sourcepub fn query_current(
&self,
holder: KnowledgeHolderRef,
query: &KnowledgeQuery,
boundary: Option<BoundaryId>,
) -> Result<KnowledgeQueryResult, KnowledgeQueryError>
pub fn query_current( &self, holder: KnowledgeHolderRef, query: &KnowledgeQuery, boundary: Option<BoundaryId>, ) -> Result<KnowledgeQueryResult, KnowledgeQueryError>
Queries the current settled holder projection using an engine-derived read cut. Callers cannot substitute a cross-holder or stale root.
§Errors
Returns an error when the holder ledger is inconsistent or the query or cursor does not match the derived read cut.
Sourcepub fn query_with_overlay(
&self,
holder: KnowledgeHolderRef,
query: &KnowledgeQuery,
boundary: Option<BoundaryId>,
overlay: &BTreeMap<KnowledgeHolderRef, BTreeMap<KnowledgeRecordId, KnowledgeRecord>>,
) -> Result<KnowledgeQueryResult, KnowledgeQueryError>
pub fn query_with_overlay( &self, holder: KnowledgeHolderRef, query: &KnowledgeQuery, boundary: Option<BoundaryId>, overlay: &BTreeMap<KnowledgeHolderRef, BTreeMap<KnowledgeRecordId, KnowledgeRecord>>, ) -> Result<KnowledgeQueryResult, KnowledgeQueryError>
Queries an omniscient system view with a same-boundary holder overlay. The returned values are owned so no mutable runtime ledger is exposed.
§Errors
Returns an error when the overlay collides with a settled record ID, when either ledger is inconsistent, or when the query or cursor does not match the derived read cut.
Trait Implementations§
Source§impl Clone for KnowledgeSnapshot
impl Clone for KnowledgeSnapshot
Source§fn clone(&self) -> KnowledgeSnapshot
fn clone(&self) -> KnowledgeSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more