pub enum AnyInclusiveRange<T> {
Full,
From {
start: T,
},
To {
end: T,
},
FromTo {
start: T,
end: T,
},
}Expand description
A type-erased inclusive range
Variants§
Full
An unbounded/open range
From
A range with a lower inclusive boundary
Fields
§
start: TThe first element (inclusive)
To
A range with an upper inclusive boundary
Fields
§
end: TThe last element (inclusive)
FromTo
A range with a lower and upper inclusive boundary
Implementations§
Source§impl<T> AnyInclusiveRange<T>
impl<T> AnyInclusiveRange<T>
Sourcepub fn to_inclusive(
&self,
start_incl: T,
end_incl: T,
) -> Result<RangeInclusive<T>, Error>where
T: PartialOrd + Copy,
pub fn to_inclusive(
&self,
start_incl: T,
end_incl: T,
) -> Result<RangeInclusive<T>, Error>where
T: PartialOrd + Copy,
Creates an inclusive range from self, replacing unspecified boundaries with the given boundaries if necessary
Trait Implementations§
Source§impl<T: Clone> Clone for AnyInclusiveRange<T>
impl<T: Clone> Clone for AnyInclusiveRange<T>
Source§fn clone(&self) -> AnyInclusiveRange<T>
fn clone(&self) -> AnyInclusiveRange<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for AnyInclusiveRange<T>
impl<T: Debug> Debug for AnyInclusiveRange<T>
Source§impl<T: PartialEq> PartialEq for AnyInclusiveRange<T>
impl<T: PartialEq> PartialEq for AnyInclusiveRange<T>
Source§impl<T> RangeBounds<T> for AnyInclusiveRange<T>
impl<T> RangeBounds<T> for AnyInclusiveRange<T>
impl<T: Copy> Copy for AnyInclusiveRange<T>
impl<T: Eq> Eq for AnyInclusiveRange<T>
impl<T> StructuralPartialEq for AnyInclusiveRange<T>
Auto Trait Implementations§
impl<T> Freeze for AnyInclusiveRange<T>where
T: Freeze,
impl<T> RefUnwindSafe for AnyInclusiveRange<T>where
T: RefUnwindSafe,
impl<T> Send for AnyInclusiveRange<T>where
T: Send,
impl<T> Sync for AnyInclusiveRange<T>where
T: Sync,
impl<T> Unpin for AnyInclusiveRange<T>where
T: Unpin,
impl<T> UnwindSafe for AnyInclusiveRange<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