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: EpochIdFirst epoch where the symbol is valid (inclusive).
end: EpochIdLast epoch where the symbol is valid (inclusive).
Implementations§
Source§impl SymbolValidityWindow
impl SymbolValidityWindow
Sourcepub fn from_epoch(start: EpochId) -> Self
pub fn from_epoch(start: EpochId) -> Self
Creates a window from the given epoch onward.
Sourcepub fn until_epoch(end: EpochId) -> Self
pub fn until_epoch(end: EpochId) -> Self
Creates a window up to and including the given epoch.
Sourcepub fn contains(&self, epoch: EpochId) -> bool
pub fn contains(&self, epoch: EpochId) -> bool
Returns true if the given epoch is within this window.
Sourcepub fn overlaps(&self, other: &Self) -> bool
pub fn overlaps(&self, other: &Self) -> bool
Returns true if this window overlaps with another.
Sourcepub fn intersection(&self, other: &Self) -> Option<Self>
pub fn intersection(&self, other: &Self) -> Option<Self>
Returns the intersection of two windows, if any.
Trait Implementations§
Source§impl Clone for SymbolValidityWindow
impl Clone for SymbolValidityWindow
Source§fn clone(&self) -> SymbolValidityWindow
fn clone(&self) -> SymbolValidityWindow
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SymbolValidityWindow
impl Debug for SymbolValidityWindow
Source§impl Default for SymbolValidityWindow
impl Default for SymbolValidityWindow
Source§impl PartialEq for SymbolValidityWindow
impl PartialEq for SymbolValidityWindow
impl Copy for SymbolValidityWindow
impl Eq for SymbolValidityWindow
impl StructuralPartialEq for SymbolValidityWindow
Auto Trait Implementations§
impl Freeze for SymbolValidityWindow
impl RefUnwindSafe for SymbolValidityWindow
impl Send for SymbolValidityWindow
impl Sync for SymbolValidityWindow
impl Unpin for SymbolValidityWindow
impl UnsafeUnpin for SymbolValidityWindow
impl UnwindSafe for SymbolValidityWindow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).