pub struct AssertionLedger {
pub assertions: Vec<Assertion>,
pub graph_refs: Vec<AssertionGraphRef>,
}Expand description
Validated immutable assertion participant content.
Fields§
§assertions: Vec<Assertion>Assertions ordered by (recorded_at, assertion_uuid).
graph_refs: Vec<AssertionGraphRef>References ordered by assertion and the public reference sort key.
Implementations§
Source§impl AssertionLedger
impl AssertionLedger
Sourcepub fn new(
assertions: Vec<Assertion>,
graph_refs: Vec<AssertionGraphRef>,
) -> Result<Self, KnowledgeError>
pub fn new( assertions: Vec<Assertion>, graph_refs: Vec<AssertionGraphRef>, ) -> Result<Self, KnowledgeError>
Validate, sort, and construct assertion content.
Sourcepub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
pub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
Merge a staged assertion set idempotently.
Sourcepub fn assertion_fingerprint(
&self,
assertion_uuid: Uuid,
) -> Result<[u8; 32], KnowledgeError>
pub fn assertion_fingerprint( &self, assertion_uuid: Uuid, ) -> Result<[u8; 32], KnowledgeError>
Canonical assertion fingerprint over exact claim bytes and sorted refs.
Sourcepub fn assertion_batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn assertion_batch(&self) -> Result<RecordBatch, KnowledgeError>
Build the authoritative assertion Arrow batch.
Sourcepub fn graph_ref_batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn graph_ref_batch(&self) -> Result<RecordBatch, KnowledgeError>
Build the authoritative assertion graph-reference Arrow batch.
Sourcepub fn from_batches(
assertion_batches: &[RecordBatch],
graph_ref_batches: &[RecordBatch],
) -> Result<Self, KnowledgeError>
pub fn from_batches( assertion_batches: &[RecordBatch], graph_ref_batches: &[RecordBatch], ) -> Result<Self, KnowledgeError>
Decode authoritative Arrow batches and re-run every invariant.
Trait Implementations§
Source§impl Clone for AssertionLedger
impl Clone for AssertionLedger
Source§fn clone(&self) -> AssertionLedger
fn clone(&self) -> AssertionLedger
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 AssertionLedger
impl Debug for AssertionLedger
Source§impl Default for AssertionLedger
impl Default for AssertionLedger
Source§fn default() -> AssertionLedger
fn default() -> AssertionLedger
Returns the “default value” for a type. Read more
impl Eq for AssertionLedger
Source§impl PartialEq for AssertionLedger
impl PartialEq for AssertionLedger
impl StructuralPartialEq for AssertionLedger
Auto Trait Implementations§
impl Freeze for AssertionLedger
impl RefUnwindSafe for AssertionLedger
impl Send for AssertionLedger
impl Sync for AssertionLedger
impl Unpin for AssertionLedger
impl UnsafeUnpin for AssertionLedger
impl UnwindSafe for AssertionLedger
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
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,
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
Compare self to
key and return true if they are equal.