pub struct Record {
pub ts: u64,
pub event: String,
pub data: Value,
}Expand description
A timestamped record in the JSONL session file.
Records use internal tagging to distinguish event types while maintaining a flat structure for easy parsing.
Fields§
§ts: u64Unix timestamp in milliseconds when the event was recorded.
event: StringThe event type discriminator (e.g., “bus.publish”, “ux.terminal.write”).
data: ValueThe event data, serialized based on event type.
Implementations§
Source§impl Record
impl Record
Sourcepub fn new(event: impl Into<String>, data: impl Serialize) -> Self
pub fn new(event: impl Into<String>, data: impl Serialize) -> Self
Creates a new record with the current timestamp.
Sourcepub fn from_bus_event(event: &Event) -> Self
pub fn from_bus_event(event: &Event) -> Self
Creates a record for an EventBus event.
Sourcepub fn from_ux_event(ux_event: &UxEvent) -> Self
pub fn from_ux_event(ux_event: &UxEvent) -> Self
Creates a record for a UX event.
Sourcepub fn meta_loop_start(
prompt_file: &str,
max_iterations: u32,
ux_mode: Option<&str>,
) -> Self
pub fn meta_loop_start( prompt_file: &str, max_iterations: u32, ux_mode: Option<&str>, ) -> Self
Creates a metadata record for loop start.
Sourcepub fn meta_iteration(iteration: u32, elapsed_ms: u64, hat: &str) -> Self
pub fn meta_iteration(iteration: u32, elapsed_ms: u64, hat: &str) -> Self
Creates a metadata record for an iteration.
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more