pub struct ZrecSource { /* private fields */ }Expand description
A ZrecReader running on the blocking pool behind a bounded channel
(#332) — the async end of a replay, and the mirror of ZrecSink.
replay interleaves sleep().awaits and network puts with its reads,
so a blocking BufRead in that loop stalls the runtime on every line —
on a cold page cache or a network filesystem, for as long as the read
takes, mid-pacing. Here the file is read ahead on a blocking thread and
the loop awaits parsed items; the queue is bounded, so a replay that
pauses for pacing does not read the whole capture into memory.
Implementations§
Source§impl ZrecSource
impl ZrecSource
Sourcepub async fn spawn<R: BufRead + Send + 'static>(source: R) -> Result<ZrecSource>
pub async fn spawn<R: BufRead + Send + 'static>(source: R) -> Result<ZrecSource>
Parse the header, then read the rest ahead on the blocking pool.
The header is awaited — a file that is not a .zrec is a refusal
before anything is scheduled, exactly as it was when the reader was
constructed inline.
pub fn header(&self) -> &ZrecHeader
Auto Trait Implementations§
impl Freeze for ZrecSource
impl RefUnwindSafe for ZrecSource
impl Send for ZrecSource
impl Sync for ZrecSource
impl Unpin for ZrecSource
impl UnsafeUnpin for ZrecSource
impl UnwindSafe for ZrecSource
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