pub struct Record {
pub version: String,
pub id: String,
pub kind: Kind,
pub ts: String,
pub parent: Option<String>,
pub meta: Option<Map<String, Value>>,
pub payload: Value,
}Expand description
One record in an .agentlog file (SPEC §3.1).
Fields§
§version: String.agentlog schema version; must equal CURRENT_VERSION for records
created by this implementation. Strict parsers reject other values.
id: StringContent id: "sha256:" + hex(sha256(canonical_json(payload))) (SPEC §6).
kind: KindRecord kind (SPEC §4).
ts: StringRFC 3339 UTC timestamp with millisecond precision, e.g. "2026-04-21T10:00:00.100Z".
Always ends in Z (no numeric offset) — SPEC §3.1.
parent: Option<String>Parent record id, or None if this is the root (metadata) record.
meta: Option<Map<String, Value>>Free-form envelope metadata. Not part of the content hash.
payload: ValueThe kind-specific body; SHA-256 of the canonical form of this field
is the id.
Implementations§
Source§impl Record
impl Record
Sourcepub fn new(
kind: Kind,
payload: Value,
ts: impl Into<String>,
parent: Option<String>,
) -> Self
pub fn new( kind: Kind, payload: Value, ts: impl Into<String>, parent: Option<String>, ) -> Self
Build a new record, computing id from the canonical-JSON of payload.
The version field is always set to CURRENT_VERSION; the caller
provides kind, payload, ts, and parent. meta is None — set
it via Record::with_meta if needed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Record
impl<'de> Deserialize<'de> for Record
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>,
impl Eq for Record
impl StructuralPartialEq for Record
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnsafeUnpin for Record
impl UnwindSafe for Record
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
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
key and return true if they are equal.