pub struct SlotWindows(/* private fields */);Expand description
The slots an action may fire at: one SlotRange object or a list of them.
Implementations§
Source§impl SlotWindows
impl SlotWindows
Sourcepub fn new(
ranges: impl IntoIterator<Item = SlotRange>,
) -> Result<Self, NoSlotWindows>
pub fn new( ranges: impl IntoIterator<Item = SlotRange>, ) -> Result<Self, NoSlotWindows>
Sorts the ranges and merges those that overlap or touch.
pub fn contains(&self, slot: u64) -> bool
Sourcepub fn covers(&self, range: SlotRange) -> bool
pub fn covers(&self, range: SlotRange) -> bool
Whether a single window holds every slot of range.
Sourcepub fn intersection(&self, range: SlotRange) -> Option<Self>
pub fn intersection(&self, range: SlotRange) -> Option<Self>
The parts of these windows inside range, or None when they share no slot.
Trait Implementations§
Source§impl Clone for SlotWindows
impl Clone for SlotWindows
Source§impl Debug for SlotWindows
impl Debug for SlotWindows
Source§impl<'de> Deserialize<'de> for SlotWindows
impl<'de> Deserialize<'de> for SlotWindows
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SlotWindows
Source§impl From<SlotRange> for SlotWindows
impl From<SlotRange> for SlotWindows
Source§impl PartialEq for SlotWindows
impl PartialEq for SlotWindows
Source§impl Serialize for SlotWindows
impl Serialize for SlotWindows
impl StructuralPartialEq for SlotWindows
Auto Trait Implementations§
impl Forget for SlotWindows
impl Freeze for SlotWindows
impl Move for SlotWindows
impl RefUnwindSafe for SlotWindows
impl Send for SlotWindows
impl Sync for SlotWindows
impl Unpin for SlotWindows
impl UnsafeUnpin for SlotWindows
impl UnwindSafe for SlotWindows
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