pub struct AssertionValidityLedger { /* private fields */ }Expand description
Validated append-only assertion-validity participant.
Implementations§
Source§impl AssertionValidityLedger
impl AssertionValidityLedger
Sourcepub fn events(&self) -> &[AssertionValidityEvent]
pub fn events(&self) -> &[AssertionValidityEvent]
The event rows are private so the ledger can trust every row it has already accepted when another validated ledger is merged.
use graphforge_knowledge::AssertionValidityLedger;
let mut ledger = AssertionValidityLedger::default();
ledger.events.clear();The read-only accessor also does not allow callers to alter a row:
use graphforge_knowledge::AssertionValidityLedger;
let ledger = AssertionValidityLedger::default();
ledger.events()[0].contract_version = 2;Return validated events in canonical order.
Sourcepub fn into_events(self) -> Vec<AssertionValidityEvent>
pub fn into_events(self) -> Vec<AssertionValidityEvent>
Consume this ledger and return its validated events in canonical order.
Sourcepub fn new(events: Vec<AssertionValidityEvent>) -> Result<Self, KnowledgeError>
pub fn new(events: Vec<AssertionValidityEvent>) -> Result<Self, KnowledgeError>
Validate, sort, and construct one complete participant.
Sourcepub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
pub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
Merge staged append-only events with exact replay semantics.
Both ledgers can only contain rows accepted by Self::new or
Self::from_batches. Since the row vector is private, previously
accepted events cannot be changed through the public API. This merge
checks identity reuse and the combined row limit, and sorts only when
it appends rows; it does not re-run row validation on either ledger.
Sourcepub fn current_for_at(
&self,
assertion_uuid: Uuid,
transaction_cutoff_micros: i64,
) -> Option<&AssertionValidityEvent>
pub fn current_for_at( &self, assertion_uuid: Uuid, transaction_cutoff_micros: i64, ) -> Option<&AssertionValidityEvent>
Select the validity interpretation visible at transaction cutoff.
Sourcepub fn is_valid_at(
&self,
assertion_uuid: Uuid,
transaction_cutoff_micros: i64,
valid_time_micros: i64,
) -> Option<bool>
pub fn is_valid_at( &self, assertion_uuid: Uuid, transaction_cutoff_micros: i64, valid_time_micros: i64, ) -> Option<bool>
Test validity using the interpretation visible at transaction cutoff.
Sourcepub fn event_fingerprint(
&self,
validity_event_uuid: Uuid,
) -> Result<[u8; 32], KnowledgeError>
pub fn event_fingerprint( &self, validity_event_uuid: Uuid, ) -> Result<[u8; 32], KnowledgeError>
Canonical fingerprint over one exact immutable event.
Sourcepub fn event_fingerprints(
&self,
) -> Result<Vec<(Uuid, [u8; 32])>, KnowledgeError>
pub fn event_fingerprints( &self, ) -> Result<Vec<(Uuid, [u8; 32])>, KnowledgeError>
Compute canonical validity fingerprints in one pass without UUID searches.
Sourcepub fn batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn batch(&self) -> Result<RecordBatch, KnowledgeError>
Build the authoritative Arrow batch.
Sourcepub fn from_batches(batches: &[RecordBatch]) -> Result<Self, KnowledgeError>
pub fn from_batches(batches: &[RecordBatch]) -> Result<Self, KnowledgeError>
Decode and validate exact Arrow batches.
Trait Implementations§
Source§impl Clone for AssertionValidityLedger
impl Clone for AssertionValidityLedger
Source§impl Debug for AssertionValidityLedger
impl Debug for AssertionValidityLedger
Source§impl Default for AssertionValidityLedger
impl Default for AssertionValidityLedger
impl Eq for AssertionValidityLedger
Source§impl PartialEq for AssertionValidityLedger
impl PartialEq for AssertionValidityLedger
impl StructuralPartialEq for AssertionValidityLedger
Auto Trait Implementations§
impl Freeze for AssertionValidityLedger
impl RefUnwindSafe for AssertionValidityLedger
impl Send for AssertionValidityLedger
impl Sync for AssertionValidityLedger
impl Unpin for AssertionValidityLedger
impl UnsafeUnpin for AssertionValidityLedger
impl UnwindSafe for AssertionValidityLedger
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.