pub enum Position<T> {
First(T),
Middle(T),
Last(T),
Only(T),
}
Expand description
A value yielded by WithPosition
.
Indicates the position of this element in the iterator results.
See .with_position()
for more information.
Variants§
First(T)
This is the first element.
Middle(T)
This is neither the first nor the last element.
Last(T)
This is the last element.
Only(T)
This is the only element.
Implementations§
Source§impl<T> Position<T>
impl<T> Position<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Return the inner value.
Trait Implementations§
impl<T: Copy> Copy for Position<T>
impl<T> StructuralPartialEq for Position<T>
Auto Trait Implementations§
impl<T> Freeze for Position<T>where
T: Freeze,
impl<T> RefUnwindSafe for Position<T>where
T: RefUnwindSafe,
impl<T> Send for Position<T>where
T: Send,
impl<T> Sync for Position<T>where
T: Sync,
impl<T> Unpin for Position<T>where
T: Unpin,
impl<T> UnwindSafe for Position<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreLayout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.