[][src]Struct vec_mut_scan::VecMutScan

pub struct VecMutScan<'a, T: 'a> { /* fields omitted */ }

Forward scan over a vector with mutation and item removal.

Provides an iterator like interface over a vector which allows mutation and removal of items. Items are kept in order and every item is moved at most once, even when items are removed. Dropping the VecMutScan mid-iteration keeps remaining items in the vector.

This does not implement the iterator trait, as the returned items borrow from this (i.e. this is a streaming iterator).

The next method returns VecMutScanItem values, which auto dereference to the vector's item type but also provide a remove and replace method.

Methods

impl<'a, T: 'a> VecMutScan<'a, T>[src]

pub fn new(vec: &mut Vec<T>) -> VecMutScan<T>[src]

Begin a scan over a vector with mutation and item removal.

pub fn next<'s>(&'s mut self) -> Option<VecMutScanItem<'s, 'a, T>>[src]

Advance to the next item of the vector.

This returns a reference wrapper that enables item removal (see VecMutScanItem).

Trait Implementations

impl<'a, T: 'a> Drop for VecMutScan<'a, T>[src]

Auto Trait Implementations

impl<'a, T> !Send for VecMutScan<'a, T>

impl<'a, T> !Sync for VecMutScan<'a, T>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]