Skip to main content

SymbolValidityWindow

Struct SymbolValidityWindow 

Source
pub struct SymbolValidityWindow {
    pub start: EpochId,
    pub end: EpochId,
}
Expand description

Defines the epoch range during which a symbol is valid.

Symbols are bound to specific epoch windows. Outside this window, operations involving the symbol should fail with epoch mismatch errors.

Fields§

§start: EpochId

First epoch where the symbol is valid (inclusive).

§end: EpochId

Last epoch where the symbol is valid (inclusive).

Implementations§

Source§

impl SymbolValidityWindow

Source

pub fn new(start: EpochId, end: EpochId) -> Self

Creates a new validity window.

§Panics

Panics if end is before start.

Source

pub fn single(epoch: EpochId) -> Self

Creates a single-epoch validity window.

Source

pub fn infinite() -> Self

Creates an infinite validity window (all epochs).

Source

pub fn from_epoch(start: EpochId) -> Self

Creates a window from the given epoch onward.

Source

pub fn until_epoch(end: EpochId) -> Self

Creates a window up to and including the given epoch.

Source

pub fn contains(&self, epoch: EpochId) -> bool

Returns true if the given epoch is within this window.

Source

pub fn overlaps(&self, other: &Self) -> bool

Returns true if this window overlaps with another.

Source

pub fn intersection(&self, other: &Self) -> Option<Self>

Returns the intersection of two windows, if any.

Source

pub fn span(&self) -> u64

Returns the span of this window in epochs.

Returns u64::MAX if the span would overflow (e.g., for infinite windows).

Source

pub fn extend_to(&self, epoch: EpochId) -> Self

Extends the window to include the given epoch.

Trait Implementations§

Source§

impl Clone for SymbolValidityWindow

Source§

fn clone(&self) -> SymbolValidityWindow

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 Copy for SymbolValidityWindow

Source§

impl Debug for SymbolValidityWindow

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for SymbolValidityWindow

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for SymbolValidityWindow

Source§

impl PartialEq for SymbolValidityWindow

Source§

fn eq(&self, other: &SymbolValidityWindow) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SymbolValidityWindow

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V