pub struct AlgorithmRunLedger {
pub runs: Vec<AlgorithmRun>,
pub events: Vec<AlgorithmRunEvent>,
}Expand description
Validated immutable run identities and append-only lifecycle events.
Fields§
§runs: Vec<AlgorithmRun>Run identities ordered by (started_at, run_uuid).
events: Vec<AlgorithmRunEvent>Events ordered by (recorded_at, event_uuid).
Implementations§
Source§impl AlgorithmRunLedger
impl AlgorithmRunLedger
Sourcepub fn new(
runs: Vec<AlgorithmRun>,
events: Vec<AlgorithmRunEvent>,
) -> Result<Self, KnowledgeError>
pub fn new( runs: Vec<AlgorithmRun>, events: Vec<AlgorithmRunEvent>, ) -> Result<Self, KnowledgeError>
Validate and normalize complete run tables.
Sourcepub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
pub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
Merge immutable identities and events, rejecting conflicting reuse.
Sourcepub fn run(&self, run_uuid: Uuid) -> Option<&AlgorithmRun>
pub fn run(&self, run_uuid: Uuid) -> Option<&AlgorithmRun>
Locate one run.
Sourcepub fn events_for(&self, run_uuid: Uuid) -> Vec<AlgorithmRunEvent>
pub fn events_for(&self, run_uuid: Uuid) -> Vec<AlgorithmRunEvent>
Return lifecycle events for one run in canonical order.
Sourcepub fn terminal_event(&self, run_uuid: Uuid) -> Option<&AlgorithmRunEvent>
pub fn terminal_event(&self, run_uuid: Uuid) -> Option<&AlgorithmRunEvent>
Return the terminal event, when one exists.
Sourcepub fn run_batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn run_batch(&self) -> Result<RecordBatch, KnowledgeError>
Encode the authoritative run table.
Sourcepub fn event_batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn event_batch(&self) -> Result<RecordBatch, KnowledgeError>
Encode the authoritative event table.
Sourcepub fn from_batches(
run_batches: &[RecordBatch],
event_batches: &[RecordBatch],
) -> Result<Self, KnowledgeError>
pub fn from_batches( run_batches: &[RecordBatch], event_batches: &[RecordBatch], ) -> Result<Self, KnowledgeError>
Decode, validate, and normalize persisted tables.
Trait Implementations§
Source§impl Clone for AlgorithmRunLedger
impl Clone for AlgorithmRunLedger
Source§impl Debug for AlgorithmRunLedger
impl Debug for AlgorithmRunLedger
Source§impl Default for AlgorithmRunLedger
impl Default for AlgorithmRunLedger
impl Eq for AlgorithmRunLedger
Source§impl PartialEq for AlgorithmRunLedger
impl PartialEq for AlgorithmRunLedger
impl StructuralPartialEq for AlgorithmRunLedger
Auto Trait Implementations§
impl Freeze for AlgorithmRunLedger
impl RefUnwindSafe for AlgorithmRunLedger
impl Send for AlgorithmRunLedger
impl Sync for AlgorithmRunLedger
impl Unpin for AlgorithmRunLedger
impl UnsafeUnpin for AlgorithmRunLedger
impl UnwindSafe for AlgorithmRunLedger
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.