pub struct ExecutionLedgerStore { /* private fields */ }Expand description
A process-independent handle to an execution ledger file.
Implementations§
Source§impl ExecutionLedgerStore
impl ExecutionLedgerStore
Sourcepub fn task_cost_summary(&self, task_id: &str) -> TaskCostSummary
pub fn task_cost_summary(&self, task_id: &str) -> TaskCostSummary
Projects token/cost/model-call totals for one task.
Sourcepub fn legacy_receipt_for_task(
&self,
task_id: &str,
) -> Option<LegacyReceiptProjectionV1>
pub fn legacy_receipt_for_task( &self, task_id: &str, ) -> Option<LegacyReceiptProjectionV1>
Builds the explicitly non-authoritative legacy receipt projection.
Sourcepub fn canonical_receipt_for_task(
&self,
task_id: &str,
) -> Option<CanonicalReceiptProjectionV1>
pub fn canonical_receipt_for_task( &self, task_id: &str, ) -> Option<CanonicalReceiptProjectionV1>
Compatibility projection; exact consumers must use the verified variant.
Sourcepub fn canonical_receipt_for_task_verified(
&self,
task_id: &str,
) -> Result<Option<CanonicalReceiptProjectionV1>>
pub fn canonical_receipt_for_task_verified( &self, task_id: &str, ) -> Result<Option<CanonicalReceiptProjectionV1>>
Returns authoritative receipt metadata or a verified unavailable error.
Source§impl ExecutionLedgerStore
impl ExecutionLedgerStore
Sourcepub fn new(path: impl Into<PathBuf>) -> Self
pub fn new(path: impl Into<PathBuf>) -> Self
Creates a store backed by path.
This compatibility constructor treats the lexical parent of path as
the trusted root. Every operation still opens each component from a
descriptor with no-follow semantics; callers that receive an external
path should prefer Self::new_verified, which makes the root and
relative path explicit and rejects traversal components up front.
Sourcepub fn new_verified(
trusted_root: impl Into<PathBuf>,
relative: impl Into<PathBuf>,
) -> Result<Self>
pub fn new_verified( trusted_root: impl Into<PathBuf>, relative: impl Into<PathBuf>, ) -> Result<Self>
Creates a store rooted at trusted_root and addressed by relative.
The root is never traversed through a symlink and relative may not be
absolute or contain ..; opened descriptors are checked again after
acquisition so a concurrent rename cannot redirect a read.
Sourcepub fn from_default() -> Result<Self>
pub fn from_default() -> Result<Self>
Creates a store at the configured default location.
Sourcepub fn append(&self, event: ExecutionEvent) -> Result<()>
pub fn append(&self, event: ExecutionEvent) -> Result<()>
Appends one event, assigning its next sequence number and chain link.
Sourcepub fn verify_chain(&self) -> Result<bool>
pub fn verify_chain(&self) -> Result<bool>
Verifies the complete on-disk chain under a shared file lock.
Sourcepub fn load(&self) -> Result<Vec<ExecutionEvent>>
pub fn load(&self) -> Result<Vec<ExecutionEvent>>
Loads all well-formed events in file order.
Sourcepub fn load_verified(&self) -> Result<Vec<ExecutionEvent>>
pub fn load_verified(&self) -> Result<Vec<ExecutionEvent>>
Loads one snapshot only when its record digests, chain, and lifecycle verify.
Sourcepub fn by_task_verified(&self, task_id: &str) -> Result<Vec<ExecutionEvent>>
pub fn by_task_verified(&self, task_id: &str) -> Result<Vec<ExecutionEvent>>
Returns verified events associated with task_id, propagating unavailable state.
Sourcepub fn by_task(&self, task_id: &str) -> Vec<ExecutionEvent>
pub fn by_task(&self, task_id: &str) -> Vec<ExecutionEvent>
Compatibility projection; exact consumers must use Self::by_task_verified.
Sourcepub fn last_sequence_verified(&self) -> Result<u64>
pub fn last_sequence_verified(&self) -> Result<u64>
Returns the verified last sequence number, or zero for an empty/missing file.
Sourcepub fn last_sequence(&self) -> u64
pub fn last_sequence(&self) -> u64
Compatibility projection; exact consumers must use Self::last_sequence_verified.
Trait Implementations§
Source§impl Clone for ExecutionLedgerStore
impl Clone for ExecutionLedgerStore
Source§impl Debug for ExecutionLedgerStore
impl Debug for ExecutionLedgerStore
impl Eq for ExecutionLedgerStore
Auto Trait Implementations§
impl Forget for ExecutionLedgerStore
impl Freeze for ExecutionLedgerStore
impl Move for ExecutionLedgerStore
impl RefUnwindSafe for ExecutionLedgerStore
impl Send for ExecutionLedgerStore
impl Sync for ExecutionLedgerStore
impl Unpin for ExecutionLedgerStore
impl UnsafeUnpin for ExecutionLedgerStore
impl UnwindSafe for ExecutionLedgerStore
Blanket Implementations§
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more