pub struct SampleCursor { /* private fields */ }std only.Expand description
A subscribed reader of a Trunk’s sample ring. Obtained via
Trunk::subscribe — read that method’s docs before creating more
than a handful of these.
Implementations§
Source§impl SampleCursor
impl SampleCursor
Sourcepub fn poll(&mut self) -> Option<SampleCursorItem>
pub fn poll(&mut self) -> Option<SampleCursorItem>
Pull the next item, if any is ready.
Loss is always reported before further data, in the same
Option<SampleCursorItem> as real samples — following
crate::byte_tap::TapItem’s precedent: a consumer cannot poll past
a Lagged/Degraded report to reach the data that follows a gap,
because there is no side channel it could forget to check instead.
§Merge order across the two retention classes
A pending Timed lag report is checked first, then a pending
Sparse lag report, then a ready Sparse sample, then a ready
Timed sample. This gives no cross-class chronological interleave
guarantee (see the module docs for why that is not
something anything downstream needs) — only that, within each
class, entries are returned in the exact order
TrunkWriter::publish produced them, with no duplication and no
unreported loss.