Enum SnapshotBracket

pub enum SnapshotBracket<'a, T> {
    Empty,
    BeforeOldest {
        oldest: (u64, &'a T),
    },
    Exact {
        snapshot: (u64, &'a T),
    },
    Between {
        before: (u64, &'a T),
        after: (u64, &'a T),
        alpha: f64,
    },
    AfterNewest {
        newest: (u64, &'a T),
    },
}
Expand description

Checked placement of a presentation time within retained snapshot history.

Only Between supplies an interpolation factor. Out-of-range results expose the nearest endpoint so the host can explicitly choose to hold it, wait for more snapshots, or apply its own extrapolation policy. See the module example for a host that only renders in-range queries.

Variants§

§

Empty

No snapshots are retained, including when the ring has zero capacity.

§

BeforeOldest

The query precedes the oldest retained tick.

Fields

§oldest: (u64, &'a T)

Earliest available tick and state.

§

Exact

The query equals a retained tick; no division or interpolation is needed.

Fields

§snapshot: (u64, &'a T)

Matching tick and state.

§

Between

Two distinct, consecutive retained snapshots surround the query.

Fields

§before: (u64, &'a T)

Snapshot strictly before the query.

§after: (u64, &'a T)

Snapshot strictly after the query.

§alpha: f64

Fraction from before to after, in [0, 1].

Uses the actual tick gap, including missing ticks. Floating-point rounding can produce an endpoint factor for a strictly interior query.

§

AfterNewest

The query follows the newest retained tick.

Fields

§newest: (u64, &'a T)

Latest available tick and state.

Trait Implementations§

§

impl<'a, T> Debug for SnapshotBracket<'a, T>
where T: Debug,

§

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

Formats the value using the given formatter. Read more
§

impl<'a, T> PartialEq for SnapshotBracket<'a, T>
where T: PartialEq,

§

fn eq(&self, other: &SnapshotBracket<'a, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'a, T> StructuralPartialEq for SnapshotBracket<'a, T>

Auto Trait Implementations§

§

impl<'a, T> Freeze for SnapshotBracket<'a, T>

§

impl<'a, T> RefUnwindSafe for SnapshotBracket<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for SnapshotBracket<'a, T>
where T: Sync,

§

impl<'a, T> Sync for SnapshotBracket<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for SnapshotBracket<'a, T>

§

impl<'a, T> UnwindSafe for SnapshotBracket<'a, T>
where T: RefUnwindSafe,

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.