pub struct Recorder { /* private fields */ }Expand description
Append-only recorder. Writes one JSONL line per Msg the main
loop chooses to log.
Implementations§
Source§impl Recorder
impl Recorder
Sourcepub fn open(path: impl Into<PathBuf>) -> Result<Self>
pub fn open(path: impl Into<PathBuf>) -> Result<Self>
Open path for append. Creates the file if it doesn’t exist.
pub fn path(&self) -> &Path
Sourcepub fn record_kind(
&mut self,
kind: MsgKind,
turn: Option<TurnId>,
body: Value,
) -> Result<()>
pub fn record_kind( &mut self, kind: MsgKind, turn: Option<TurnId>, body: Value, ) -> Result<()>
Record a single MsgKind + optional body JSON. Meant for the
narrow subset of variants that survive round-trip. Full
Msg-graph coverage comes in C9.
pub fn flush(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Recorder
impl RefUnwindSafe for Recorder
impl Send for Recorder
impl Sync for Recorder
impl Unpin for Recorder
impl UnsafeUnpin for Recorder
impl UnwindSafe for Recorder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more