pub struct Range<Idx, Direction> { /* private fields */ }
Expand description
A range
This is basically a start, and end, an a direction.
The index type can be any type, but to get a useful range, you need to supply something that implements some common traits, like Clone, and PartialEq; but also One (the identity element used) as well as AddAssign and SubAssign (to work increment/decrement the index).
Implementations§
Source§impl<Idx> Range<Idx, Upwards>
Range counting up
impl<Idx> Range<Idx, Upwards>
Range counting up
Sourcepub fn collect<B>(self) -> Bwhere
B: FromIterator<Idx>,
pub fn collect<B>(self) -> Bwhere
B: FromIterator<Idx>,
Collect range into a container
Works for any container type that implements FromIterator
.
Source§impl<Idx> Range<Idx, Downwards>
Range counting down
impl<Idx> Range<Idx, Downwards>
Range counting down
Sourcepub fn collect<B>(self) -> Bwhere
B: FromIterator<Idx>,
pub fn collect<B>(self) -> Bwhere
B: FromIterator<Idx>,
Collect range into a container
Works for any container type that implements FromIterator
.
Trait Implementations§
Source§impl<Idx: PartialOrd, Direction: PartialOrd> PartialOrd for Range<Idx, Direction>
impl<Idx: PartialOrd, Direction: PartialOrd> PartialOrd for Range<Idx, Direction>
impl<Idx: Eq, Direction: Eq> Eq for Range<Idx, Direction>
impl<Idx, Direction> StructuralPartialEq for Range<Idx, Direction>
Auto Trait Implementations§
impl<Idx, Direction> Freeze for Range<Idx, Direction>
impl<Idx, Direction> RefUnwindSafe for Range<Idx, Direction>where
Direction: RefUnwindSafe,
Idx: RefUnwindSafe,
impl<Idx, Direction> Send for Range<Idx, Direction>
impl<Idx, Direction> Sync for Range<Idx, Direction>
impl<Idx, Direction> Unpin for Range<Idx, Direction>
impl<Idx, Direction> UnwindSafe for Range<Idx, Direction>where
Direction: UnwindSafe,
Idx: 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