pub struct ZrecWriter<W: Write> { /* private fields */ }Expand description
A .zrec writer over any byte sink: header first, then rows as they
arrive, drop records in place. Wrap the sink in a BufWriter — the
writer emits line-at-a-time and never buffers samples itself, so a
capture streams in bounded memory.
Implementations§
Source§impl<W: Write> ZrecWriter<W>
impl<W: Write> ZrecWriter<W>
Sourcepub fn new(out: W, header: &ZrecHeader) -> Result<Self>
pub fn new(out: W, header: &ZrecHeader) -> Result<Self>
Write the header line and hand back a row writer.
Sourcepub fn write_sample(&mut self, view: &SampleView) -> Result<()>
pub fn write_sample(&mut self, view: &SampleView) -> Result<()>
Write one observed sample as a row.
The payload rides lossless ("bytes"), the pacing offset is the
observer’s arrival clock ("t", µs since the capture epoch), and
the publisher’s HLC — when one rode the sample — is carried
informatively ("timestamp"): replay re-stamps (RFC 09 §5.2). QoS
is stored as a profile name only when the wire’s actual axes match
one (RFC 04 §3); axes matching no profile are not approximated.
Sourcepub fn write_dropped(&mut self, n: u64) -> Result<()>
pub fn write_dropped(&mut self, n: u64) -> Result<()>
Write a drop record where the gap happened (O6 on a file).
Auto Trait Implementations§
impl<W> Freeze for ZrecWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for ZrecWriter<W>where
W: RefUnwindSafe,
impl<W> Send for ZrecWriter<W>where
W: Send,
impl<W> Sync for ZrecWriter<W>where
W: Sync,
impl<W> Unpin for ZrecWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for ZrecWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for ZrecWriter<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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