pub struct RecordingWriter<W: Write> { /* private fields */ }Expand description
Writes a compact binary recording: a version header, then length-framed events with fixed little-endian numbers, optional-id flags and UTF-8 symbols. Version 2 retains resting order participant and placement metadata. No runtime or filesystem policy is imposed; a host can use a buffered file on native targets or bytes in a browser.
Implementations§
Source§impl<W: Write> RecordingWriter<W>
impl<W: Write> RecordingWriter<W>
Sourcepub fn write(&mut self, event: &ReplayEvent) -> Result<()>
pub fn write(&mut self, event: &ReplayEvent) -> Result<()>
Appends an event without flushing the underlying stream. Invalid data writes nothing.
Sourcepub fn capture(
&mut self,
events: impl IntoIterator<Item = Result<ReplayEvent>>,
) -> Result<()>
pub fn capture( &mut self, events: impl IntoIterator<Item = Result<ReplayEvent>>, ) -> Result<()>
Records a host event stream until it ends or either reading or writing fails. The first
error is returned unchanged; previously written complete events remain in the stream.
Run blocking streams outside the UI thread and call Self::finish to flush storage.
Auto Trait Implementations§
impl<W> Freeze for RecordingWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for RecordingWriter<W>where
W: RefUnwindSafe,
impl<W> Send for RecordingWriter<W>where
W: Send,
impl<W> Sync for RecordingWriter<W>where
W: Sync,
impl<W> Unpin for RecordingWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for RecordingWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for RecordingWriter<W>where
W: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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