pub struct ReasoningLedger {
pub records: Vec<ReasoningRecord>,
}Expand description
Validated append-only reasoning participant content.
Fields§
§records: Vec<ReasoningRecord>Records ordered by (recorded_at, reasoning_uuid).
Implementations§
Source§impl ReasoningLedger
impl ReasoningLedger
Sourcepub fn new(records: Vec<ReasoningRecord>) -> Result<Self, KnowledgeError>
pub fn new(records: Vec<ReasoningRecord>) -> Result<Self, KnowledgeError>
Validate, sort, and construct one complete participant.
Sourcepub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
pub fn merge(&self, staged: &Self) -> Result<Self, KnowledgeError>
Merge staged append-only records with idempotent exact replay.
Sourcepub fn record_fingerprint(
&self,
reasoning_uuid: Uuid,
) -> Result<[u8; 32], KnowledgeError>
pub fn record_fingerprint( &self, reasoning_uuid: Uuid, ) -> Result<[u8; 32], KnowledgeError>
Canonical fingerprint over the exact immutable record.
Sourcepub fn current_for(&self, assertion_uuid: Uuid) -> Option<&ReasoningRecord>
pub fn current_for(&self, assertion_uuid: Uuid) -> Option<&ReasoningRecord>
Resolve the current leaf without mutating or hiding branch history.
Sourcepub fn batch(&self) -> Result<RecordBatch, KnowledgeError>
pub fn batch(&self) -> Result<RecordBatch, KnowledgeError>
Build the authoritative Arrow batch.
Sourcepub fn from_batches(batches: &[RecordBatch]) -> Result<Self, KnowledgeError>
pub fn from_batches(batches: &[RecordBatch]) -> Result<Self, KnowledgeError>
Decode authoritative batches and revalidate the complete ledger.
Trait Implementations§
Source§impl Clone for ReasoningLedger
impl Clone for ReasoningLedger
Source§impl Debug for ReasoningLedger
impl Debug for ReasoningLedger
Source§impl Default for ReasoningLedger
impl Default for ReasoningLedger
impl Eq for ReasoningLedger
Source§impl PartialEq for ReasoningLedger
impl PartialEq for ReasoningLedger
impl StructuralPartialEq for ReasoningLedger
Auto Trait Implementations§
impl Freeze for ReasoningLedger
impl RefUnwindSafe for ReasoningLedger
impl Send for ReasoningLedger
impl Sync for ReasoningLedger
impl Unpin for ReasoningLedger
impl UnsafeUnpin for ReasoningLedger
impl UnwindSafe for ReasoningLedger
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.