pub struct AnyRange<T> {
pub start: Bound<T>,
pub end: Bound<T>,
}
Fields§
§start: Bound<T>
§end: Bound<T>
Implementations§
Source§impl<T> AnyRange<T>
impl<T> AnyRange<T>
pub fn new(start: Bound<T>, end: Bound<T>) -> Self
pub fn from<R: AsRange<Item = T>>(range: R) -> AnyRange<T>where
T: Clone,
pub fn into_bounds(self) -> (Bound<T>, Bound<T>)
pub fn is_empty(&self) -> boolwhere
T: Measure + PartialEnum,
pub fn len(&self) -> T::Len
pub fn bounded_len(&self) -> Option<T::Len>where
T: Measure + MaybeBounded,
pub fn pick(&self) -> Option<T>
pub fn add<S>(&mut self, other: &S)
pub fn intersects<S>(&self, other: &S) -> bool
pub fn intersection(&self, other: &Self) -> Self
Source§impl<'a, T> AnyRange<&'a T>
impl<'a, T> AnyRange<&'a T>
pub fn ref_is_empty(&self) -> boolwhere
T: PartialEnum + Measure,
Trait Implementations§
Source§impl<T: Measure + PartialEnum> AsRange for AnyRange<T>
impl<T: Measure + PartialEnum> AsRange for AnyRange<T>
fn is_empty(&self) -> bool
fn intersects<R: AsRange>(&self, other: &R) -> bool
fn connected_to<R: AsRange>(&self, other: &R) -> bool
fn intersected_with<'a, R: AsRange<Item = Self::Item>>( &'a self, other: &'a R, ) -> AnyRange<&'a Self::Item>
fn without<'a, R: AsRange<Item = Self::Item>>( &'a self, other: &'a R, ) -> Difference<&'a Self::Item>
fn product<'a, R: AsRange<Item = Self::Item>>( &'a self, other: &'a R, ) -> Product<&'a Self::Item>
Source§impl<T> From<RangeInclusive<T>> for AnyRange<T>
impl<T> From<RangeInclusive<T>> for AnyRange<T>
Source§fn from(value: RangeInclusive<T>) -> Self
fn from(value: RangeInclusive<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<RangeToInclusive<T>> for AnyRange<T>
impl<T> From<RangeToInclusive<T>> for AnyRange<T>
Source§fn from(value: RangeToInclusive<T>) -> Self
fn from(value: RangeToInclusive<T>) -> Self
Converts to this type from the input type.
Source§impl<T: Measure + PartialEnum> IntoRange for AnyRange<T>
impl<T: Measure + PartialEnum> IntoRange for AnyRange<T>
fn into_range(self) -> AnyRange<Self::Item>
Source§impl<T> Ord for AnyRange<T>
impl<T> Ord for AnyRange<T>
Source§impl<T, U> PartialOrd<AnyRange<U>> for AnyRange<T>
impl<T, U> PartialOrd<AnyRange<U>> for AnyRange<T>
Source§impl<T> RangeBounds<T> for AnyRange<T>
impl<T> RangeBounds<T> for AnyRange<T>
impl<T: Copy> Copy for AnyRange<T>
impl<T> Eq for AnyRange<T>
Auto Trait Implementations§
impl<T> Freeze for AnyRange<T>where
T: Freeze,
impl<T> RefUnwindSafe for AnyRange<T>where
T: RefUnwindSafe,
impl<T> Send for AnyRange<T>where
T: Send,
impl<T> Sync for AnyRange<T>where
T: Sync,
impl<T> Unpin for AnyRange<T>where
T: Unpin,
impl<T> UnwindSafe for AnyRange<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