pub struct Interval { /* private fields */ }
Expand description
Represent integer interval.
Implementations§
source§impl Interval
impl Interval
sourcepub fn near(&self, other: &Self) -> bool
pub fn near(&self, other: &Self) -> bool
Return true
if no integers between self
and other
exists.
sourcepub fn split(&self, length: u64) -> (Self, Self)
pub fn split(&self, length: u64) -> (Self, Self)
Split self
into two intervals.
First - [self.start; self.start + length)
, second - [self.start + length; self.end)
.
Panics
- Panics if
length
>self.length
Trait Implementations§
source§impl PartialEq for Interval
impl PartialEq for Interval
impl Copy for Interval
impl Eq for Interval
impl StructuralEq for Interval
impl StructuralPartialEq for Interval
Auto Trait Implementations§
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnwindSafe for Interval
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