Skip to main content

SampleCursor

Struct SampleCursor 

Source
pub struct SampleCursor { /* private fields */ }
Available on crate feature std only.
Expand description

A subscribed reader of a Trunk’s sample ring. Obtained via Trunk::subscriberead that method’s docs before creating more than a handful of these.

Implementations§

Source§

impl SampleCursor

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.