[−][src]Struct vec_mut_scan::VecMutScan
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,