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: bool

This is the initial element (also true if there's exactly one element)

is_last: bool

This is the final element (also true if there's exactly one element)

Implementations

impl Position

fn is_exactly_one(self) -> bool

This is the first and the last element at the same time, and there are no more elements

fn is_middle(self) -> bool

This is neither first nor last element, and there will be more elements

fn is_first(self) -> bool

This is the initial element (also true if there's exactly one element)

fn is_last(self) -> bool

This 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

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

impl<T> Any for Position where T: 'static + ?Sized,

impl<T> Borrow<T> for Position where T: ?Sized,

impl<T> BorrowMut<T> for Position where T: ?Sized,

impl<T> CloneToUninit for Position where T: Clone,

impl<T> From<T> for Position

impl<T> IntoEither for Position

impl<T> ToOwned for Position where T: Clone,

impl<T, U> Into<U> for Position where U: From<T>,

impl<T, U> TryFrom<U> for Position where U: Into<T>,

impl<T, U> TryInto<U> for Position where U: TryFrom<T>,