pub struct SessionJournal { /* private fields */ }Expand description
The append-only writer. Every Self::append is one line plus \n,
flushed before returning — see the module docs.
Implementations§
Source§impl SessionJournal
impl SessionJournal
Sourcepub fn open_append(path: &Path) -> Result<SessionJournal, Error>
pub fn open_append(path: &Path) -> Result<SessionJournal, Error>
Address the journal at path for appending. The file itself is
created by the first Self::append, not here.
Sourcepub fn with_fixed_timestamp(self, ts: impl Into<String>) -> SessionJournal
pub fn with_fixed_timestamp(self, ts: impl Into<String>) -> SessionJournal
The same writer with a fixed RFC3339 stamp, so a byte-comparison
test has time as no variable at all — the
crate::sidecar::SidecarWriter::create_with_timestamp precedent.
Sourcepub fn append(&mut self, op: JournalOp) -> Result<(), Error>
pub fn append(&mut self, op: JournalOp) -> Result<(), Error>
Append one operation: serialize, write the whole line, flush.
Sourcepub fn append_message(&mut self, msg: &ChatMessage) -> Result<(), Error>
pub fn append_message(&mut self, msg: &ChatMessage) -> Result<(), Error>
Append one conversation message (the JournalOp::Message shortcut
every agent-loop call site uses). The record carries the same
full-fidelity NativeTurn shape the native-v2 sidecar writes,
metadata included — a journal line and a sidecar line describe the
same message identically.
Auto Trait Implementations§
impl Freeze for SessionJournal
impl RefUnwindSafe for SessionJournal
impl Send for SessionJournal
impl Sync for SessionJournal
impl Unpin for SessionJournal
impl UnsafeUnpin for SessionJournal
impl UnwindSafe for SessionJournal
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