pub struct EvidenceLedger { /* private fields */ }Expand description
Validated immutable evidence participant content.
The link collection is private: validated rows can be borrowed with
EvidenceLedger::links or moved out with EvidenceLedger::into_links.
Direct mutation is rejected by the compiler:
ⓘ
use graphforge_knowledge::EvidenceLedger;
let mut ledger = EvidenceLedger::default();
ledger.links.clear();Implementations§
Source§impl EvidenceLedger
impl EvidenceLedger
Sourcepub fn new(links: Vec<EvidenceLink>) -> Result<Self, KnowledgeError>
pub fn new(links: Vec<EvidenceLink>) -> Result<Self, KnowledgeError>
Validate, sort, and construct evidence content.
Sourcepub fn links(&self) -> &[EvidenceLink]
pub fn links(&self) -> &[EvidenceLink]
Borrow the validated evidence links in canonical order.
Sourcepub fn into_links(self) -> Vec<EvidenceLink>
pub fn into_links(self) -> Vec<EvidenceLink>
Consume the ledger and return its validated evidence links in canonical order.
Sourcepub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
pub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
Merge staged links idempotently.
Sourcepub fn evidence_fingerprint(
&self,
evidence_uuid: Uuid,
) -> Result<[u8; 32], KnowledgeError>
pub fn evidence_fingerprint( &self, evidence_uuid: Uuid, ) -> Result<[u8; 32], KnowledgeError>
Canonical fingerprint over normalized immutable content.
Sourcepub fn evidence_fingerprints(
&self,
) -> Result<Vec<(Uuid, [u8; 32])>, KnowledgeError>
pub fn evidence_fingerprints( &self, ) -> Result<Vec<(Uuid, [u8; 32])>, KnowledgeError>
Compute canonical evidence fingerprints in one pass without UUID searches.
Sourcepub fn batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn batch(&self) -> Result<RecordBatch, KnowledgeError>
Build the authoritative evidence Arrow batch.
Sourcepub fn from_batches(batches: &[RecordBatch]) -> Result<Self, KnowledgeError>
pub fn from_batches(batches: &[RecordBatch]) -> Result<Self, KnowledgeError>
Decode authoritative Arrow batches and re-run every invariant.
Trait Implementations§
Source§impl Clone for EvidenceLedger
impl Clone for EvidenceLedger
Source§impl Debug for EvidenceLedger
impl Debug for EvidenceLedger
Source§impl Default for EvidenceLedger
impl Default for EvidenceLedger
Source§impl PartialEq for EvidenceLedger
impl PartialEq for EvidenceLedger
impl StructuralPartialEq for EvidenceLedger
Auto Trait Implementations§
impl Freeze for EvidenceLedger
impl RefUnwindSafe for EvidenceLedger
impl Send for EvidenceLedger
impl Sync for EvidenceLedger
impl Unpin for EvidenceLedger
impl UnsafeUnpin for EvidenceLedger
impl UnwindSafe for EvidenceLedger
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