pub struct HypothesisLedger { /* private fields */ }Expand description
Validated complete hypothesis state participants.
Implementations§
Source§impl HypothesisLedger
impl HypothesisLedger
Sourcepub fn new(
groups: Vec<HypothesisGroup>,
membership_events: Vec<HypothesisMembershipEvent>,
selection_events: Vec<HypothesisSelectionEvent>,
) -> Result<Self, KnowledgeError>
pub fn new( groups: Vec<HypothesisGroup>, membership_events: Vec<HypothesisMembershipEvent>, selection_events: Vec<HypothesisSelectionEvent>, ) -> Result<Self, KnowledgeError>
Validate, order, and construct all three record families together.
Sourcepub fn groups(&self) -> &[HypothesisGroup]
pub fn groups(&self) -> &[HypothesisGroup]
Return validated groups in canonical order.
Sourcepub fn membership_events(&self) -> &[HypothesisMembershipEvent]
pub fn membership_events(&self) -> &[HypothesisMembershipEvent]
Return validated membership history in canonical order.
Sourcepub fn selection_events(&self) -> &[HypothesisSelectionEvent]
pub fn selection_events(&self) -> &[HypothesisSelectionEvent]
Return validated selection history in canonical order.
Sourcepub fn group_fingerprint(
&self,
group_uuid: Uuid,
) -> Result<[u8; 32], KnowledgeError>
pub fn group_fingerprint( &self, group_uuid: Uuid, ) -> Result<[u8; 32], KnowledgeError>
Canonical fingerprint over one exact immutable hypothesis group.
Sourcepub fn membership_fingerprint(
&self,
membership_event_uuid: Uuid,
) -> Result<[u8; 32], KnowledgeError>
pub fn membership_fingerprint( &self, membership_event_uuid: Uuid, ) -> Result<[u8; 32], KnowledgeError>
Canonical fingerprint over one exact membership event.
Sourcepub fn selection_fingerprint(
&self,
selection_event_uuid: Uuid,
) -> Result<[u8; 32], KnowledgeError>
pub fn selection_fingerprint( &self, selection_event_uuid: Uuid, ) -> Result<[u8; 32], KnowledgeError>
Canonical fingerprint over one exact selection event.
Sourcepub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
pub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
Merge append-only participants with exact replay semantics.
Sourcepub fn group_batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn group_batch(&self) -> Result<RecordBatch, KnowledgeError>
Build the authoritative group batch.
Sourcepub fn membership_batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn membership_batch(&self) -> Result<RecordBatch, KnowledgeError>
Build the authoritative membership-history batch.
Sourcepub fn selection_batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn selection_batch(&self) -> Result<RecordBatch, KnowledgeError>
Build the authoritative selection-history batch.
Sourcepub fn from_batches(
group_batches: &[RecordBatch],
membership_batches: &[RecordBatch],
selection_batches: &[RecordBatch],
) -> Result<Self, KnowledgeError>
pub fn from_batches( group_batches: &[RecordBatch], membership_batches: &[RecordBatch], selection_batches: &[RecordBatch], ) -> Result<Self, KnowledgeError>
Decode and validate the three authoritative record families.
Sourcepub fn current_members(&self, group_uuid: Uuid) -> Vec<Uuid>
pub fn current_members(&self, group_uuid: Uuid) -> Vec<Uuid>
Current membership for one group, ordered by assertion UUID.
Sourcepub fn current_selection(&self, group_uuid: Uuid) -> Option<Uuid>
pub fn current_selection(&self, group_uuid: Uuid) -> Option<Uuid>
Current explicit selection for one group.
Trait Implementations§
Source§impl Clone for HypothesisLedger
impl Clone for HypothesisLedger
Source§fn clone(&self) -> HypothesisLedger
fn clone(&self) -> HypothesisLedger
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HypothesisLedger
impl Debug for HypothesisLedger
Source§impl Default for HypothesisLedger
impl Default for HypothesisLedger
Source§fn default() -> HypothesisLedger
fn default() -> HypothesisLedger
impl Eq for HypothesisLedger
Source§impl PartialEq for HypothesisLedger
impl PartialEq for HypothesisLedger
impl StructuralPartialEq for HypothesisLedger
Auto Trait Implementations§
impl Freeze for HypothesisLedger
impl RefUnwindSafe for HypothesisLedger
impl Send for HypothesisLedger
impl Sync for HypothesisLedger
impl Unpin for HypothesisLedger
impl UnsafeUnpin for HypothesisLedger
impl UnwindSafe for HypothesisLedger
Blanket Implementations§
impl<T> Allocation for T
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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.