pub struct LedgerEntry {
pub timestamp: DateTime<Utc>,
pub tool_id: String,
pub args_hash: Digest256,
pub idempotency_key: String,
pub result_hash: Digest256,
pub side_effect_class: SideEffectClass,
pub session_hmac: String,
}Expand description
A single ledger entry. Wire format effects.entry.v1.
Fields§
§timestamp: DateTime<Utc>Wall-clock timestamp at the moment the tool call was issued.
tool_id: StringTool identifier as registered with the crate::ToolProxy.
args_hash: Digest256SHA-256 of the canonical-JSON-serialized tool args.
idempotency_key: StringPer-call idempotency key. ULID-shaped for sortability; the proxy mints
these and persists them so a re-issued call after restore reuses the
key and is therefore safe under Idempotent semantics.
result_hash: Digest256SHA-256 of the canonical-JSON-serialized tool result.
side_effect_class: SideEffectClassTool author’s declared side-effect class.
session_hmac: StringHMAC chain: HMAC(session_secret, prev_entry_hash || this_entry_minus_hmac).
Hex-encoded.
Implementations§
Source§impl LedgerEntry
impl LedgerEntry
Sourcepub fn entry_hash_without_hmac(&self) -> Result<Digest256>
pub fn entry_hash_without_hmac(&self) -> Result<Digest256>
SHA-256 of the canonical-JSON serialization of this entry with
session_hmac = "". Used both for chaining and for storage CAS.
Trait Implementations§
Source§impl Clone for LedgerEntry
impl Clone for LedgerEntry
Source§fn clone(&self) -> LedgerEntry
fn clone(&self) -> LedgerEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LedgerEntry
impl Debug for LedgerEntry
Source§impl<'de> Deserialize<'de> for LedgerEntry
impl<'de> Deserialize<'de> for LedgerEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LedgerEntry
impl RefUnwindSafe for LedgerEntry
impl Send for LedgerEntry
impl Sync for LedgerEntry
impl Unpin for LedgerEntry
impl UnsafeUnpin for LedgerEntry
impl UnwindSafe for LedgerEntry
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
Mutably borrows from an owned value. Read more