pub struct SourceLedger {
pub sources: Vec<Source>,
}Expand description
Validated immutable Source table.
Fields§
§sources: Vec<Source>Sources ordered by (recorded_at, source_uuid).
Implementations§
Source§impl SourceLedger
impl SourceLedger
Sourcepub fn new(sources: Vec<Source>) -> Result<Self, KnowledgeError>
pub fn new(sources: Vec<Source>) -> Result<Self, KnowledgeError>
Validate, sort, and construct a Source table.
Sourcepub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
pub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
Merge staged rows into an existing ledger.
Sourcepub fn source_fingerprint(
&self,
source_uuid: Uuid,
) -> Result<[u8; 32], KnowledgeError>
pub fn source_fingerprint( &self, source_uuid: Uuid, ) -> Result<[u8; 32], KnowledgeError>
Canonical semantic fingerprint over immutable Source content, excluding clock fields.
Excludes provenance_uuid and recorded_at_micros so that a retry with the same
semantic content but a different clock value compares equal to the committed row.
Sourcepub fn batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn batch(&self) -> Result<RecordBatch, KnowledgeError>
Encode the authoritative Arrow batch.
Sourcepub fn from_batches(batches: &[RecordBatch]) -> Result<Self, KnowledgeError>
pub fn from_batches(batches: &[RecordBatch]) -> Result<Self, KnowledgeError>
Decode one or more Arrow batches.
Trait Implementations§
Source§impl Clone for SourceLedger
impl Clone for SourceLedger
Source§impl Debug for SourceLedger
impl Debug for SourceLedger
Source§impl Default for SourceLedger
impl Default for SourceLedger
impl Eq for SourceLedger
Source§impl PartialEq for SourceLedger
impl PartialEq for SourceLedger
impl StructuralPartialEq for SourceLedger
Auto Trait Implementations§
impl Freeze for SourceLedger
impl RefUnwindSafe for SourceLedger
impl Send for SourceLedger
impl Sync for SourceLedger
impl Unpin for SourceLedger
impl UnsafeUnpin for SourceLedger
impl UnwindSafe for SourceLedger
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.