pub struct AssertionLedger { /* private fields */ }Expand description
Validated immutable assertion participant content.
The validated row collections are private so callers cannot invalidate the
cross-vector graph-reference constraints after construction. Borrow them
through Self::assertions and Self::graph_refs, or consume both with
Self::into_parts.
use graphforge_knowledge::AssertionLedger;
let mut ledger = AssertionLedger::default();
ledger.assertions.clear();Implementations§
Source§impl AssertionLedger
impl AssertionLedger
Sourcepub fn assertions(&self) -> &[Assertion]
pub fn assertions(&self) -> &[Assertion]
Borrow assertions in deterministic order.
Sourcepub fn graph_refs(&self) -> &[AssertionGraphRef]
pub fn graph_refs(&self) -> &[AssertionGraphRef]
Borrow graph references in deterministic order.
Sourcepub fn into_parts(self) -> (Vec<Assertion>, Vec<AssertionGraphRef>)
pub fn into_parts(self) -> (Vec<Assertion>, Vec<AssertionGraphRef>)
Consume the ledger and return its assertions and graph references.
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_fingerprints(
&self,
) -> Result<Vec<(Uuid, [u8; 32])>, KnowledgeError>
pub fn assertion_fingerprints( &self, ) -> Result<Vec<(Uuid, [u8; 32])>, KnowledgeError>
Compute canonical assertion fingerprints with a single grouped graph-ref pass.
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§impl Debug for AssertionLedger
impl Debug for AssertionLedger
Source§impl Default for AssertionLedger
impl Default for AssertionLedger
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
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.