Struct Position
pub struct Position { pub is_first: bool, pub is_last: bool }
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
impl Position
fn is_exactly_one(self) -> boolThis is the first and the last element at the same time, and there are no more elements
fn is_middle(self) -> boolThis is neither first nor last element, and there will be more elements
fn is_first(self) -> boolThis is the initial element (also true if there's exactly one element)
fn is_last(self) -> boolThis is the final element (also true if there's exactly one element)
Trait Implementations
impl Clone for Position
fn clone(&self) -> Self
impl Copy for Position
impl Debug for Position
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Position
impl PartialEq for Position
fn eq(&self, other: &Self) -> bool