pub struct ProvenanceLedger {
pub events: Vec<ProvenanceEvent>,
pub lineage: Vec<LineageRecord>,
}Expand description
Validated immutable provenance participant content.
Fields§
§events: Vec<ProvenanceEvent>Events ordered by (recorded_at, provenance_uuid).
lineage: Vec<LineageRecord>Lineage ordered by event time and public history sort key.
Implementations§
Source§impl ProvenanceLedger
impl ProvenanceLedger
Sourcepub fn new(
events: Vec<ProvenanceEvent>,
lineage: Vec<LineageRecord>,
) -> Result<Self, ProvenanceError>
pub fn new( events: Vec<ProvenanceEvent>, lineage: Vec<LineageRecord>, ) -> Result<Self, ProvenanceError>
Validate, sort, and construct ledger content.
§Errors
Rejects row limits, invalid versions/identities, duplicate IDs, dangling lineage, duplicate role ordinals, and non-canonical derived UUIDs.
Sourcepub fn merge(&self, staged: &Self) -> Result<Self, ProvenanceError>
pub fn merge(&self, staged: &Self) -> Result<Self, ProvenanceError>
Merge a staged ledger idempotently into an existing ledger.
§Errors
Identical operation event-sets are idempotent. Reuse of an operation UUID with a different complete event-set, or reuse of an event, lineage, or role/ordinal identity with different canonical content conflicts.
Sourcepub fn event_batch(&self) -> Result<RecordBatch, ProvenanceError>
pub fn event_batch(&self) -> Result<RecordBatch, ProvenanceError>
Sourcepub fn lineage_batch(&self) -> Result<RecordBatch, ProvenanceError>
pub fn lineage_batch(&self) -> Result<RecordBatch, ProvenanceError>
Build the authoritative lineage Arrow batch.
§Errors
Returns a structured Arrow construction failure.
Sourcepub fn from_batches(
event_batches: &[RecordBatch],
lineage_batches: &[RecordBatch],
) -> Result<Self, ProvenanceError>
pub fn from_batches( event_batches: &[RecordBatch], lineage_batches: &[RecordBatch], ) -> Result<Self, ProvenanceError>
Decode authoritative Arrow batches and re-run every domain invariant.
§Errors
Rejects schema drift, nulls, malformed UUIDs, unknown closed values, unsupported versions, duplicates, dangling references, and row limits.
Trait Implementations§
Source§impl Clone for ProvenanceLedger
impl Clone for ProvenanceLedger
Source§impl Debug for ProvenanceLedger
impl Debug for ProvenanceLedger
Source§impl Default for ProvenanceLedger
impl Default for ProvenanceLedger
impl Eq for ProvenanceLedger
Source§impl PartialEq for ProvenanceLedger
impl PartialEq for ProvenanceLedger
impl StructuralPartialEq for ProvenanceLedger
Auto Trait Implementations§
impl Freeze for ProvenanceLedger
impl RefUnwindSafe for ProvenanceLedger
impl Send for ProvenanceLedger
impl Sync for ProvenanceLedger
impl Unpin for ProvenanceLedger
impl UnsafeUnpin for ProvenanceLedger
impl UnwindSafe for ProvenanceLedger
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.