pub struct BufferedSessionArchive { /* private fields */ }Expand description
Background archive writer used from the terminal event loop.
The handle only serializes events and queues commands; all filesystem work
happens on its worker thread. Queued journal lines and metadata edits are
retried until flush or drop makes them durable, and the
entry’s updated_at advances at each successful boundary that received
events so the session browser can order by last activity.
Implementations§
Source§impl BufferedSessionArchive
impl BufferedSessionArchive
pub fn id(&self) -> &str
Sourcepub fn append(&self, event: &ArchiveEvent) -> Result<(), PersistenceError>
pub fn append(&self, event: &ArchiveEvent) -> Result<(), PersistenceError>
Serialize and queue one journal record without filesystem I/O in the caller.
pub fn append_human( &self, text: impl Into<String>, direct: bool, ) -> Result<(), PersistenceError>
pub fn append_agent(&self, event: &AgentEvent) -> Result<(), PersistenceError>
Sourcepub fn replace_metadata(
&self,
metadata: SessionMetadata,
) -> Result<(), PersistenceError>
pub fn replace_metadata( &self, metadata: SessionMetadata, ) -> Result<(), PersistenceError>
Queue a complete provider metadata snapshot, retaining unknown keys.
Sourcepub fn update_metadata<F>(&self, apply: F) -> Result<(), PersistenceError>
pub fn update_metadata<F>(&self, apply: F) -> Result<(), PersistenceError>
Queue an in-place provider metadata edit, preserving unknown keys.
Sourcepub fn update_entry<F>(&self, apply: F) -> Result<(), PersistenceError>
pub fn update_entry<F>(&self, apply: F) -> Result<(), PersistenceError>
Queue an archive entry edit (title, state, roster). The session id is pinned to the directory and titles stay bounded.
Sourcepub fn touch(&self) -> Result<(), PersistenceError>
pub fn touch(&self) -> Result<(), PersistenceError>
Queue an activity timestamp update.
Sourcepub fn checkpoint(&self) -> Result<(), PersistenceError>
pub fn checkpoint(&self) -> Result<(), PersistenceError>
Request a durable checkpoint without blocking the UI.
Sourcepub fn flush(&self) -> Result<(), PersistenceError>
pub fn flush(&self) -> Result<(), PersistenceError>
Drain queued records and metadata edits and make them durable.