pub struct Position {
pub is_first: bool,
pub is_last: bool,
}Expand description
The first component of the value yielded by WithPosition.
Indicates the position of this element in the iterator results.
See .with_position() for more information.
Fields§
§is_first: boolThis is the initial element (also true if there’s exactly one element)
is_last: boolThis is the final element (also true if there’s exactly one element)
Implementations§
Source§impl Position
impl Position
Sourcepub fn is_exactly_one(self) -> bool
pub fn is_exactly_one(self) -> bool
This is the first and the last element at the same time, and there are no more elements
Sourcepub fn is_middle(self) -> bool
pub fn is_middle(self) -> bool
This is neither first nor last element, and there will be more elements
Trait Implementations§
impl Copy for Position
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
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 more