Skip to main content

SampleCursorItem

Enum SampleCursorItem 

Source
#[non_exhaustive]
pub enum SampleCursorItem { Timed { track_id: u32, sample: Sample, }, Sparse { track_id: u32, sample: Sample, }, Lagged { skipped: u64, }, Degraded { skipped: u64, }, }
Available on crate feature std only.
Expand description

One item SampleCursor::poll can hand back: data from either retention class, or a loss report.

#[non_exhaustive]: this is the growth point for anything a cursor might need to surface beyond “sample” or “loss” later, without a breaking change to every match arm in the workspace.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Timed

A RetentionClass::Timed sample for track_id.

Fields

§track_id: u32

The publishing track.

§sample: Sample

The sample itself. Cloned from the ring’s stored copy — Sample.data: Bytes is shared, not copied; see Zero-copy fan-out.

§

Sparse

A RetentionClass::Sparse sample for track_id.

Fields

§track_id: u32

The publishing track.

§sample: Sample

The sample itself; see the Timed variant’s doc for the zero-copy note.

§

Lagged

This cursor fell behind the Timed ring: skipped entries were evicted before it read them. Ordinary loss — resume from the next sample; see RetentionClass::Timed.

Fields

§skipped: u64

Exact count of Timed entries evicted since this cursor’s last successful read of that class.

§

Degraded

This cursor fell behind the Sparse ring: skipped entries were evicted before it read them. Not ordinary loss — the consumer’s derived state (e.g. splice-point tracking) is now wrong, not merely gapped; see RetentionClass::Sparse for what a consumer is expected to do about it.

Fields

§skipped: u64

Exact count of Sparse entries evicted since this cursor’s last successful read of that class.

Trait Implementations§

Source§

impl Clone for SampleCursorItem

Source§

fn clone(&self) -> SampleCursorItem

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SampleCursorItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.