pub trait MapExt: Iterator + Sized {
Show 16 methods
// Provided methods
fn map_deref<'a, R, U>(self) -> MapFn<Self, &'a U>
where Self::Item: ThisRef<'a, Out = R>,
R: ?Sized + Deref<Target = U> + 'a,
U: ?Sized + 'a { ... }
fn map_deref_mut<'a, R, U>(self) -> MapFn<Self, &'a mut U>
where Self::Item: ThisMut<'a, Out = R>,
R: ?Sized + DerefMut<Target = U> + 'a,
U: ?Sized + 'a { ... }
fn map_unpack<U>(self) -> MapFn<Self, U>
where Self::Item: Unpack<Output = U> { ... }
fn map_into<U>(self) -> MapFn<Self, U>
where Self::Item: Into<U> { ... }
fn map_try_into<U>(
self,
) -> MapFn<Self, Result<U, <Self::Item as TryInto<U>>::Error>>
where Self::Item: TryInto<U> { ... }
fn map_parse<U>(self) -> MapFn<Self, Result<U, U::Err>>
where Self::Item: AsRef<str>,
U: FromStr { ... }
fn map_as_ref<'a, U>(self) -> MapFn<Self, &'a U>
where Self::Item: ThisRef<'a>,
U: ?Sized + 'a,
<Self::Item as ThisRef<'a>>::Out: AsRef<U> + 'a { ... }
fn map_as_mut<'a, U>(self) -> MapFn<Self, &'a mut U>
where Self::Item: ThisMut<'a>,
U: ?Sized + 'a,
<Self::Item as ThisRef<'a>>::Out: AsMut<U> + 'a { ... }
fn map_borrow<'a, U>(self) -> MapFn<Self, &'a U>
where Self::Item: ThisRef<'a>,
U: ?Sized + 'a,
<Self::Item as ThisRef<'a>>::Out: Borrow<U> + 'a { ... }
fn map_borrow_mut<'a, U>(self) -> MapFn<Self, &'a mut U>
where Self::Item: ThisMut<'a>,
U: ?Sized + 'a,
<Self::Item as ThisRef<'a>>::Out: BorrowMut<U> + 'a { ... }
fn map_into_iter<I>(self) -> MapFn<Self, I>
where Self::Item: IntoIterator<IntoIter = I> { ... }
fn map_collect<A, C>(self) -> MapFn<Self, C>
where Self::Item: Iterator<Item = A>,
C: FromIterator<A> { ... }
fn map_to_owned<R, U>(self) -> MapFn<Self, U>
where Self::Item: Deref<Target = R>,
R: ?Sized + ToOwned<Owned = U> { ... }
fn map_to_string<R>(self) -> MapFn<Self, String>
where Self::Item: Deref<Target = R>,
R: ?Sized + ToString { ... }
fn map_index<'a, R, I, U>(self, index: I) -> MapIndex<'a, Self, I> ⓘ
where Self::Item: ThisRef<'a, Out = R>,
R: ?Sized + Index<I, Output = U>,
U: ?Sized + 'a,
I: Clone { ... }
fn map_index_mut<'a, R, I, U>(self, index: I) -> MapIndexMut<'a, Self, I> ⓘ
where Self::Item: ThisMut<'a, Out = R>,
R: ?Sized + IndexMut<I, Output = U>,
U: ?Sized + 'a,
I: Clone { ... }
}
Expand description
Implement commonly used combinations of Iterator::map
Provided Methods§
Sourcefn map_deref_mut<'a, R, U>(self) -> MapFn<Self, &'a mut U>
fn map_deref_mut<'a, R, U>(self) -> MapFn<Self, &'a mut U>
Sourcefn map_unpack<U>(self) -> MapFn<Self, U>
fn map_unpack<U>(self) -> MapFn<Self, U>
Sourcefn map_as_ref<'a, U>(self) -> MapFn<Self, &'a U>
fn map_as_ref<'a, U>(self) -> MapFn<Self, &'a U>
Sourcefn map_as_mut<'a, U>(self) -> MapFn<Self, &'a mut U>
fn map_as_mut<'a, U>(self) -> MapFn<Self, &'a mut U>
Sourcefn map_borrow<'a, U>(self) -> MapFn<Self, &'a U>
fn map_borrow<'a, U>(self) -> MapFn<Self, &'a U>
Sourcefn map_borrow_mut<'a, U>(self) -> MapFn<Self, &'a mut U>
fn map_borrow_mut<'a, U>(self) -> MapFn<Self, &'a mut U>
Sourcefn map_into_iter<I>(self) -> MapFn<Self, I>where
Self::Item: IntoIterator<IntoIter = I>,
fn map_into_iter<I>(self) -> MapFn<Self, I>where
Self::Item: IntoIterator<IntoIter = I>,
Sourcefn map_collect<A, C>(self) -> MapFn<Self, C>
fn map_collect<A, C>(self) -> MapFn<Self, C>
Sourcefn map_to_owned<R, U>(self) -> MapFn<Self, U>
fn map_to_owned<R, U>(self) -> MapFn<Self, U>
Sourcefn map_to_string<R>(self) -> MapFn<Self, String>
fn map_to_string<R>(self) -> MapFn<Self, String>
Sourcefn map_index<'a, R, I, U>(self, index: I) -> MapIndex<'a, Self, I> ⓘ
fn map_index<'a, R, I, U>(self, index: I) -> MapIndex<'a, Self, I> ⓘ
like iter.map(|v| &v[index])
Sourcefn map_index_mut<'a, R, I, U>(self, index: I) -> MapIndexMut<'a, Self, I> ⓘ
fn map_index_mut<'a, R, I, U>(self, index: I) -> MapIndexMut<'a, Self, I> ⓘ
like iter.map(|v| &mut v[index])
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.