pub struct Interval<T>where
T: Copy + Ord,{
pub start: T,
pub end: T,
}
Expand description
Represents an interval of values x..y
(much like Range<usize>
)
which supports various arithmetic operations.
Fields§
§start: T
§end: T
Implementations§
Trait Implementations§
source§impl<T> From<RangeInclusive<T>> for Interval<T>where
T: Copy + Ord,
impl<T> From<RangeInclusive<T>> for Interval<T>where T: Copy + Ord,
source§fn from(r: RangeInclusive<T>) -> Self
fn from(r: RangeInclusive<T>) -> Self
Converts to this type from the input type.
source§impl<T> Ord for Interval<T>where
T: Copy + Ord + Ord,
impl<T> Ord for Interval<T>where T: Copy + Ord + Ord,
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T> PartialEq for Interval<T>where
T: Copy + Ord + PartialEq,
impl<T> PartialEq for Interval<T>where T: Copy + Ord + PartialEq,
source§impl<T> PartialOrd for Interval<T>where
T: Copy + Ord + PartialOrd,
impl<T> PartialOrd for Interval<T>where T: Copy + Ord + PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T> Copy for Interval<T>where T: Copy + Ord + Copy,
impl<T> Eq for Interval<T>where T: Copy + Ord + Eq,
impl<T> StructuralEq for Interval<T>where T: Copy + Ord,
impl<T> StructuralPartialEq for Interval<T>where T: Copy + Ord,
Auto Trait Implementations§
impl<T> RefUnwindSafe for Interval<T>where T: RefUnwindSafe,
impl<T> Send for Interval<T>where T: Send,
impl<T> Sync for Interval<T>where T: Sync,
impl<T> Unpin for Interval<T>where T: Unpin,
impl<T> UnwindSafe for Interval<T>where T: UnwindSafe,
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