Struct interval_adapter::Interval
source · pub struct Interval<T = isize>{ /* private fields */ }
Expand description
Canonical implementation of interval. Other implementations of interval is convertible to it.
Both core::ops::Range, core::ops::RangeInclusive are convertable to crate::Interval
Implementations§
Trait Implementations§
source§impl<T> From<RangeInclusive<T>> for Interval<T>
impl<T> From<RangeInclusive<T>> for Interval<T>
source§fn from(src: RangeInclusive<T>) -> Self
fn from(src: RangeInclusive<T>) -> Self
Converts to this type from the input type.
source§impl<T> From<RangeToInclusive<T>> for Interval<T>
impl<T> From<RangeToInclusive<T>> for Interval<T>
source§fn from(src: RangeToInclusive<T>) -> Self
fn from(src: RangeToInclusive<T>) -> Self
Converts to this type from the input type.
source§impl<T> IntoIterator for &Interval<T>
impl<T> IntoIterator for &Interval<T>
source§impl<T> IntoIterator for Interval<T>
impl<T> IntoIterator for Interval<T>
source§impl<T> NonIterableInterval<T> for Interval<T>
impl<T> NonIterableInterval<T> for Interval<T>
source§fn bounds(&self) -> (Bound<T>, Bound<T>)
fn bounds(&self) -> (Bound<T>, Bound<T>)
Interval in closed format as pair of numbers.
To convert open endpoint to closed add or subtract one.
source§fn closed_left(&self) -> T
fn closed_left(&self) -> T
The left endpoint of the interval, converting interval into closed one.
source§fn closed_right(&self) -> T
fn closed_right(&self) -> T
The right endpoint of the interval, converting interval into closed one.
source§fn closed_len(&self) -> T
fn closed_len(&self) -> T
Length of the interval, converting interval into closed one.
source§impl<T> PartialEq for Interval<T>
impl<T> PartialEq for Interval<T>
impl<T> Copy for Interval<T>
impl<T> Eq for Interval<T>
impl<T> StructuralPartialEq for Interval<T>
Auto Trait Implementations§
impl<T> Freeze for Interval<T>
impl<T> RefUnwindSafe for Interval<T>
impl<T> Send for Interval<T>
impl<T> Sync for Interval<T>
impl<T> Unpin for Interval<T>
impl<T> UnwindSafe for Interval<T>
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, All> IntoInterval<T> for All
impl<T, All> IntoInterval<T> for All
source§fn into_interval(self) -> Interval<T>
fn into_interval(self) -> Interval<T>
Convert it into canonical interval.