Skip to main content

SegmentCursor

Struct SegmentCursor 

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

A subscribed reader of a Trunk’s segment log. Obtained via Trunk::subscribe_segments (ordinary, lossy-on-overflow) or Trunk::pin_segments (pinning, ArchiveOverrun-governed) — read those methods’ docs, and The DVR contradiction, before creating more than a handful of these.

Implementations§

Source§

impl SegmentCursor

Source

pub fn poll(&mut self) -> Option<SegmentCursorItem>

Pull the next item, if any is ready.

Loss is always reported before further data, in the same Option<SegmentCursorItem> as real segments — the same cannot-be-skipped-past precedent as SampleCursor::poll/ crate::byte_tap::TapItem.

Trait Implementations§

Source§

impl Drop for SegmentCursor

Source§

fn drop(&mut self)

Release this cursor’s pin, if it has one, so a dropped/abandoned pinning cursor cannot hold retention open (or a StallIngest writer blocked) forever — the same “a dead consumer must not grow memory without limit” guarantee as an actively-Gap-ping cursor, for the case where the consumer disappeared instead of choosing a policy.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. 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> 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.