IntoRefMutIter

Struct IntoRefMutIter 

Source
pub struct IntoRefMutIter<'a, I, T>
where I: Iterator<Item = &'a mut T>, T: 'a,
{ /* private fields */ }
Expand description

Adapter that turns Iterator into RefMutIterator.

§Examples

let mut samples = vec![1, 2, 3];
let mut iter = IntoRefMutIter::new(samples.iter_mut());
while let Some(item) = iter.next_mut() {
    *item += 1;
}

let expecteds = vec![2, 3, 4];
assert_eq!(samples, expecteds);

Implementations§

Source§

impl<'a, I, T> IntoRefMutIter<'a, I, T>
where I: Iterator<Item = &'a mut T>, T: 'a,

Source

pub fn new<A: IntoIterator<IntoIter = I>>(iter: A) -> Self

Creates a new value.

Trait Implementations§

Source§

impl<'a, I, T> Clone for IntoRefMutIter<'a, I, T>
where I: Iterator<Item = &'a mut T> + Clone, T: 'a + Clone,

Source§

fn clone(&self) -> IntoRefMutIter<'a, I, T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, I, T> Debug for IntoRefMutIter<'a, I, T>
where I: Iterator<Item = &'a mut T> + Debug, T: 'a + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, I, T> RefIterator for IntoRefMutIter<'a, I, T>
where I: Iterator<Item = &'a mut T>, T: 'a,

Source§

type Item = T

The type of the elements being iterated over.
Source§

fn next(&mut self) -> Option<&Self::Item>

Advances the iterator and returns the next value. Read more
Source§

fn icloned(self) -> ICloned<Self>
where Self: Sized, Self::Item: Clone,

Creates an iterator that clone dynamic borrowing elements. Read more
Source§

fn iflat_map<'call, F>(self, f: F) -> IFlatMap<'call, Self, F>
where Self: Sized, F: for<'a> FnIFlatMap<&'a Self::Item>,

Creates an iterator that flattens mapped each dynamic borrowing iterators. Read more
Source§

fn imap<B, F>(self, f: F) -> IMap<Self, F>
where Self: Sized, F: FnMut(&Self::Item) -> B,

Creates an iterator that maps dynamic borrowing elements. Read more
Source§

fn eq<I>(self, other: I) -> bool
where Self: Sized, Self::Item: PartialEq<I::Item>, I: IntoRefIterator,

Determines if the elements of this is equal to those of another. Read more
Source§

impl<'a, I, T> RefIteratorBase for IntoRefMutIter<'a, I, T>
where I: Iterator<Item = &'a mut T>, T: 'a,

Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
Source§

impl<'a, I, T> RefMutIterator for IntoRefMutIter<'a, I, T>
where I: Iterator<Item = &'a mut T>, T: 'a,

Source§

fn next_mut(&mut self) -> Option<&mut Self::Item>

Advances the iterator and returns the next mutable value. Read more

Auto Trait Implementations§

§

impl<'a, I, T> Freeze for IntoRefMutIter<'a, I, T>
where I: Freeze,

§

impl<'a, I, T> RefUnwindSafe for IntoRefMutIter<'a, I, T>
where I: RefUnwindSafe,

§

impl<'a, I, T> Send for IntoRefMutIter<'a, I, T>
where I: Send,

§

impl<'a, I, T> Sync for IntoRefMutIter<'a, I, T>
where I: Sync,

§

impl<'a, I, T> Unpin for IntoRefMutIter<'a, I, T>
where I: Unpin,

§

impl<'a, I, T> UnwindSafe for IntoRefMutIter<'a, I, T>
where I: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRefIterator for T
where T: RefIterator,

Source§

type Item = <T as RefIterator>::Item

The type of the elements being iterated over.
Source§

type IntoRefIter = T

Which kind of iterator are we turning this into?
Source§

fn into_ref_iter(self) -> <T as IntoRefIterator>::IntoRefIter

Creates an iterator from a value.
Source§

impl<T> IntoRefMutIterator for T
where T: RefMutIterator,

Source§

type Item = <T as RefIterator>::Item

The type of the elements being iterated over.
Source§

type IntoRefMutIter = T

Which kind of iterator are we turning this into?
Source§

fn into_ref_mut_iter(self) -> <T as IntoRefMutIterator>::IntoRefMutIter

Creates an iterator from a value.
Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.