pub struct SessionEventLog { /* private fields */ }Expand description
Canonical append-only event log for a single session.
All session history is reconstructable from this log. Live conversation state is never read back into context from here; the log is only consumed for revert, compaction, analytics, and long-term-learning queries.
Implementations§
Source§impl SessionEventLog
impl SessionEventLog
Sourcepub fn open(
workspace: &Path,
session_id: &str,
) -> Result<Self, SessionStoreError>
pub fn open( workspace: &Path, session_id: &str, ) -> Result<Self, SessionStoreError>
Open the log for session_id, creating the session directory tree and
rebuilding the index from events.jsonl if it already exists.
Sourcepub fn append(&self, event: &ThreadEvent) -> Result<(), SessionStoreError>
pub fn append(&self, event: &ThreadEvent) -> Result<(), SessionStoreError>
Append an event to the log and update the in-memory index/manifest.
Sourcepub fn reconstruct_turn(
&self,
turn: u64,
) -> Result<Vec<ThreadEvent>, SessionStoreError>
pub fn reconstruct_turn( &self, turn: u64, ) -> Result<Vec<ThreadEvent>, SessionStoreError>
Reconstruct every event belonging to turn.
Sourcepub fn turn_count(&self) -> u64
pub fn turn_count(&self) -> u64
Number of turns recorded.
Sourcepub fn event_count(&self) -> u64
pub fn event_count(&self) -> u64
Number of events recorded.
Sourcepub fn manifest(&self) -> SessionManifest
pub fn manifest(&self) -> SessionManifest
Snapshot of the session manifest.
Sourcepub fn turn_index(&self) -> TurnIndex
pub fn turn_index(&self) -> TurnIndex
Snapshot of the turn index.
Sourcepub fn complete(&self) -> Result<(), SessionStoreError>
pub fn complete(&self) -> Result<(), SessionStoreError>
Mark the session completed and flush metadata.
Auto Trait Implementations§
impl !Freeze for SessionEventLog
impl RefUnwindSafe for SessionEventLog
impl Send for SessionEventLog
impl Sync for SessionEventLog
impl Unpin for SessionEventLog
impl UnsafeUnpin for SessionEventLog
impl UnwindSafe for SessionEventLog
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