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
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 KnowledgeSnapshot
impl Debug for KnowledgeSnapshot
Source§impl Default for KnowledgeSnapshot
impl Default for KnowledgeSnapshot
Source§fn default() -> KnowledgeSnapshot
fn default() -> KnowledgeSnapshot
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for KnowledgeSnapshot
impl<'de> Deserialize<'de> for KnowledgeSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for KnowledgeSnapshot
Source§impl PartialEq for KnowledgeSnapshot
impl PartialEq for KnowledgeSnapshot
Source§impl Serialize for KnowledgeSnapshot
impl Serialize for KnowledgeSnapshot
impl StructuralPartialEq for KnowledgeSnapshot
Auto Trait Implementations§
impl Freeze for KnowledgeSnapshot
impl RefUnwindSafe for KnowledgeSnapshot
impl Send for KnowledgeSnapshot
impl Sync for KnowledgeSnapshot
impl Unpin for KnowledgeSnapshot
impl UnsafeUnpin for KnowledgeSnapshot
impl UnwindSafe for KnowledgeSnapshot
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