pub struct IterMut<'a, T>where
T: 'a,{ /* private fields */ }
Expand description
Implementations§
source§impl<'a, T> IterMut<'a, T>
impl<'a, T> IterMut<'a, T>
1.4.0 · sourcepub fn into_slice(self) -> &'a mut [T]
pub fn into_slice(self) -> &'a mut [T]
将底层数据视为原始数据的子切片。
为避免创建 &mut
引用该别名,这会强制使用迭代器。
Examples
基本用法:
// 首先,我们声明一个具有 `iter_mut` 方法的类型以获取 `IterMut` 结构体 (此处为 `&[usize]`) :
let mut slice = &mut [1, 2, 3];
{
// 然后,我们得到迭代器:
let mut iter = slice.iter_mut();
// 我们转到下一个元素:
iter.next();
// 因此,如果我们在此处打印 `into_slice` 方法返回的内容,则得到 "[2, 3]":
println!("{:?}", iter.into_slice());
}
// 现在,让我们修改切片的值:
{
// 首先,我们返回迭代器:
let mut iter = slice.iter_mut();
// 我们更改 `next` 方法返回的切片的第一个元素的值:
*iter.next().unwrap() += 1;
}
// 现在切片是 "[2, 2, 3]":
println!("{slice:?}");
Run1.53.0 · sourcepub fn as_slice(&self) -> &[T]
pub fn as_slice(&self) -> &[T]
将底层数据视为原始数据的子切片。
为了避免创建 &mut [T]
引用该别名,返回的切片借用了应用了该方法的迭代器的生命周期。
Examples
基本用法:
let mut slice: &mut [usize] = &mut [1, 2, 3];
// 首先,我们得到迭代器:
let mut iter = slice.iter_mut();
// 因此,如果我们检查 `as_slice` 方法在这里返回的内容,则得到 "[1, 2, 3]":
assert_eq!(iter.as_slice(), &[1, 2, 3]);
// 接下来,我们转到切片的第二个元素:
iter.next();
// 现在 `as_slice` 返回 "[2, 3]":
assert_eq!(iter.as_slice(), &[2, 3]);
Runsourcepub fn as_mut_slice(&mut self) -> &mut [T]
🔬This is a nightly-only experimental API. (slice_iter_mut_as_mut_slice
#93079)
pub fn as_mut_slice(&mut self) -> &mut [T]
slice_iter_mut_as_mut_slice
#93079)将底层数据视为原始数据的无效子切片。
为了避免创建 &mut [T]
引用该别名,返回的切片借用了应用了该方法的迭代器的生命周期。
Examples
基本用法:
#![feature(slice_iter_mut_as_mut_slice)]
let mut slice: &mut [usize] = &mut [1, 2, 3];
// 首先,我们得到迭代器:
let mut iter = slice.iter_mut();
// 然后,我们从中得到一个错误切片:
let mut_slice = iter.as_mut_slice();
// 因此,如果我们检查 `as_mut_slice` 方法返回的内容,我们有 "[1, 2, 3]":
assert_eq!(mut_slice, &mut [1, 2, 3]);
// 我们可以使用它来改变切片:
mut_slice[0] = 4;
mut_slice[2] = 5;
// 接下来,我们可以移动到切片的第二个元素,检查它是否产生了我们刚刚编写的值:
assert_eq!(iter.next(), Some(&mut 4));
// 现在 `as_mut_slice` 返回 "[2, 5]":
assert_eq!(iter.as_mut_slice(), &mut [2, 5]);
RunTrait Implementations§
source§impl<'a, T> DoubleEndedIterator for IterMut<'a, T>
impl<'a, T> DoubleEndedIterator for IterMut<'a, T>
source§fn advance_back_by(&mut self, n: usize) -> Result<(), NonZeroUsize>
fn advance_back_by(&mut self, n: usize) -> Result<(), NonZeroUsize>
🔬This is a nightly-only experimental API. (
iter_advance_by
#77404)通过
n
元素从后向前推进迭代器。 Read more1.27.0 · source§fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere
Self: Sized,
F: FnMut(B, Self::Item) -> R,
R: Try<Output = B>,
fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Output = B>,
这是
Iterator::try_fold()
的反向版本:它从迭代器的后面开始接收元素。 Read moresource§impl<T> ExactSizeIterator for IterMut<'_, T>
impl<T> ExactSizeIterator for IterMut<'_, T>
source§impl<'a, T> Iterator for IterMut<'a, T>
impl<'a, T> Iterator for IterMut<'a, T>
source§fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>
fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>
🔬This is a nightly-only experimental API. (
iter_advance_by
#77404)通过
n
元素使迭代器前进。 Read moresource§fn for_each<F>(self, f: F)where
IterMut<'a, T>: Sized,
F: FnMut(<IterMut<'a, T> as Iterator>::Item),
fn for_each<F>(self, f: F)where IterMut<'a, T>: Sized, F: FnMut(<IterMut<'a, T> as Iterator>::Item),
在迭代器的每个元素上调用一个闭包。 Read more
source§fn all<F>(&mut self, f: F) -> boolwhere
IterMut<'a, T>: Sized,
F: FnMut(<IterMut<'a, T> as Iterator>::Item) -> bool,
fn all<F>(&mut self, f: F) -> boolwhere IterMut<'a, T>: Sized, F: FnMut(<IterMut<'a, T> as Iterator>::Item) -> bool,
测试迭代器的每个元素是否与谓词匹配。 Read more
source§fn any<F>(&mut self, f: F) -> boolwhere
IterMut<'a, T>: Sized,
F: FnMut(<IterMut<'a, T> as Iterator>::Item) -> bool,
fn any<F>(&mut self, f: F) -> boolwhere IterMut<'a, T>: Sized, F: FnMut(<IterMut<'a, T> as Iterator>::Item) -> bool,
测试迭代器的任何元素是否与谓词匹配。 Read more
source§fn find<P>(
&mut self,
predicate: P
) -> Option<<IterMut<'a, T> as Iterator>::Item>where
IterMut<'a, T>: Sized,
P: FnMut(&<IterMut<'a, T> as Iterator>::Item) -> bool,
fn find<P>( &mut self, predicate: P ) -> Option<<IterMut<'a, T> as Iterator>::Item>where IterMut<'a, T>: Sized, P: FnMut(&<IterMut<'a, T> as Iterator>::Item) -> bool,
搜索满足谓词的迭代器的元素。 Read more
source§fn find_map<B, F>(&mut self, f: F) -> Option<B>where
IterMut<'a, T>: Sized,
F: FnMut(<IterMut<'a, T> as Iterator>::Item) -> Option<B>,
fn find_map<B, F>(&mut self, f: F) -> Option<B>where IterMut<'a, T>: Sized, F: FnMut(<IterMut<'a, T> as Iterator>::Item) -> Option<B>,
将函数应用于迭代器的元素,并返回第一个非 None 的结果。 Read more
source§fn position<P>(&mut self, predicate: P) -> Option<usize>where
IterMut<'a, T>: Sized,
P: FnMut(<IterMut<'a, T> as Iterator>::Item) -> bool,
fn position<P>(&mut self, predicate: P) -> Option<usize>where IterMut<'a, T>: Sized, P: FnMut(<IterMut<'a, T> as Iterator>::Item) -> bool,
在迭代器中搜索元素,并返回其索引。 Read more
source§fn rposition<P>(&mut self, predicate: P) -> Option<usize>where
P: FnMut(<IterMut<'a, T> as Iterator>::Item) -> bool,
IterMut<'a, T>: Sized + ExactSizeIterator + DoubleEndedIterator,
fn rposition<P>(&mut self, predicate: P) -> Option<usize>where P: FnMut(<IterMut<'a, T> as Iterator>::Item) -> bool, IterMut<'a, T>: Sized + ExactSizeIterator + DoubleEndedIterator,
从右侧搜索迭代器中的元素,并返回其索引。 Read more
source§fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
fn next_chunk<const N: usize>( &mut self ) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where Self: Sized,
🔬This is a nightly-only experimental API. (
iter_next_chunk
#98326)推进迭代器并返回包含下一个
N
值的数组。 Read more1.28.0 · source§fn step_by(self, step: usize) -> StepBy<Self> ⓘwhere
Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self> ⓘwhere Self: Sized,
创建一个从同一点开始的迭代器,但在每次迭代时以给定的数量逐步执行。 Read more
source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter> ⓘwhere
Self: Sized,
U: IntoIterator<Item = Self::Item>,
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter> ⓘwhere Self: Sized, U: IntoIterator<Item = Self::Item>,
接受两个迭代器,并依次在两个迭代器上创建一个新的迭代器。 Read more
source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter> ⓘwhere
Self: Sized,
U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter> ⓘwhere Self: Sized, U: IntoIterator,
将两个迭代器压缩为成对的单个迭代器。 Read more
source§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> ⓘwhere
Self: Sized,
G: FnMut() -> Self::Item,
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> ⓘwhere Self: Sized, G: FnMut() -> Self::Item,
🔬This is a nightly-only experimental API. (
iter_intersperse
#79524)创建一个新的迭代器,该迭代器将
separator
生成的项放在原始迭代器的相邻项之间。 Read moresource§fn map<B, F>(self, f: F) -> Map<Self, F> ⓘwhere
Self: Sized,
F: FnMut(Self::Item) -> B,
fn map<B, F>(self, f: F) -> Map<Self, F> ⓘwhere Self: Sized, F: FnMut(Self::Item) -> B,
获取一个闭包并创建一个迭代器,该迭代器在每个元素上调用该闭包。 Read more
source§fn filter<P>(self, predicate: P) -> Filter<Self, P> ⓘwhere
Self: Sized,
P: FnMut(&Self::Item) -> bool,
fn filter<P>(self, predicate: P) -> Filter<Self, P> ⓘwhere Self: Sized, P: FnMut(&Self::Item) -> bool,
创建一个迭代器,该迭代器使用闭包确定是否应产生元素。 Read more
source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> ⓘwhere
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> ⓘwhere Self: Sized, F: FnMut(Self::Item) -> Option<B>,
创建一个同时过滤和映射的迭代器。 Read more
source§fn enumerate(self) -> Enumerate<Self> ⓘwhere
Self: Sized,
fn enumerate(self) -> Enumerate<Self> ⓘwhere Self: Sized,
创建一个迭代器,该迭代器给出当前迭代次数以及下一个值。 Read more
source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> ⓘwhere
Self: Sized,
P: FnMut(&Self::Item) -> bool,
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> ⓘwhere Self: Sized, P: FnMut(&Self::Item) -> bool,
source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> ⓘwhere
Self: Sized,
P: FnMut(&Self::Item) -> bool,
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> ⓘwhere Self: Sized, P: FnMut(&Self::Item) -> bool,
创建一个迭代器,该迭代器根据谓词产生元素。 Read more
1.57.0 · source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P> ⓘwhere
Self: Sized,
P: FnMut(Self::Item) -> Option<B>,
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P> ⓘwhere Self: Sized, P: FnMut(Self::Item) -> Option<B>,
创建一个迭代器,该迭代器均基于谓词和映射生成元素。 Read more
source§fn take(self, n: usize) -> Take<Self> ⓘwhere
Self: Sized,
fn take(self, n: usize) -> Take<Self> ⓘwhere Self: Sized,
创建一个迭代器,它产生第一个
n
元素,如果底层迭代器提前结束,则产生更少的元素。 Read moresource§fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> ⓘwhere
Self: Sized,
F: FnMut(&mut St, Self::Item) -> Option<B>,
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> ⓘwhere Self: Sized, F: FnMut(&mut St, Self::Item) -> Option<B>,
source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> ⓘwhere
Self: Sized,
U: IntoIterator,
F: FnMut(Self::Item) -> U,
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> ⓘwhere Self: Sized, U: IntoIterator, F: FnMut(Self::Item) -> U,
创建一个迭代器,其工作方式类似于 map,但它会将嵌套的结构展平。 Read more
source§fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘwhere
Self: Sized,
F: FnMut(&Self::Item),
fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘwhere Self: Sized, F: FnMut(&Self::Item),
对迭代器的每个元素执行某些操作,将值传递给它。 Read more
source§fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere
E: Extend<Self::Item>,
Self: Sized,
fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere E: Extend<Self::Item>, Self: Sized,
🔬This is a nightly-only experimental API. (
iter_collect_into
#94780)将迭代器中的所有项收集到一个集合中。 Read more
source§fn partition<B, F>(self, f: F) -> (B, B)where
Self: Sized,
B: Default + Extend<Self::Item>,
F: FnMut(&Self::Item) -> bool,
fn partition<B, F>(self, f: F) -> (B, B)where Self: Sized, B: Default + Extend<Self::Item>, F: FnMut(&Self::Item) -> bool,
消耗一个迭代器,从中创建两个集合。 Read more
source§fn partition_in_place<'a, T, P>(self, predicate: P) -> usizewhere
T: 'a,
Self: Sized + DoubleEndedIterator<Item = &'a mut T>,
P: FnMut(&T) -> bool,
fn partition_in_place<'a, T, P>(self, predicate: P) -> usizewhere T: 'a, Self: Sized + DoubleEndedIterator<Item = &'a mut T>, P: FnMut(&T) -> bool,
🔬This is a nightly-only experimental API. (
iter_partition_in_place
#62543)source§fn is_partitioned<P>(self, predicate: P) -> boolwhere
Self: Sized,
P: FnMut(Self::Item) -> bool,
fn is_partitioned<P>(self, predicate: P) -> boolwhere Self: Sized, P: FnMut(Self::Item) -> bool,
🔬This is a nightly-only experimental API. (
iter_is_partitioned
#62544)1.27.0 · source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere
Self: Sized,
F: FnMut(B, Self::Item) -> R,
R: Try<Output = B>,
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Output = B>,
一个迭代器方法,它只要成功返回就应用函数,并产生单个最终值。 Read more
1.27.0 · source§fn try_for_each<F, R>(&mut self, f: F) -> Rwhere
Self: Sized,
F: FnMut(Self::Item) -> R,
R: Try<Output = ()>,
fn try_for_each<F, R>(&mut self, f: F) -> Rwhere Self: Sized, F: FnMut(Self::Item) -> R, R: Try<Output = ()>,
一个迭代器方法,该方法将一个容易犯错的函数应用于迭代器中的每个项,在第一个错误处停止并返回该错误。 Read more
source§fn fold<B, F>(self, init: B, f: F) -> Bwhere
Self: Sized,
F: FnMut(B, Self::Item) -> B,
fn fold<B, F>(self, init: B, f: F) -> Bwhere Self: Sized, F: FnMut(B, Self::Item) -> B,
通过应用操作将每个元素
fold
到一个累加器中,返回最终结果。 Read more1.51.0 · source§fn reduce<F>(self, f: F) -> Option<Self::Item>where
Self: Sized,
F: FnMut(Self::Item, Self::Item) -> Self::Item,
fn reduce<F>(self, f: F) -> Option<Self::Item>where Self: Sized, F: FnMut(Self::Item, Self::Item) -> Self::Item,
通过重复应用缩减操作,将元素缩减为一个。 Read more
source§fn try_reduce<F, R>(
&mut self,
f: F
) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere
Self: Sized,
F: FnMut(Self::Item, Self::Item) -> R,
R: Try<Output = Self::Item>,
<R as Try>::Residual: Residual<Option<Self::Item>>,
fn try_reduce<F, R>( &mut self, f: F ) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere Self: Sized, F: FnMut(Self::Item, Self::Item) -> R, R: Try<Output = Self::Item>, <R as Try>::Residual: Residual<Option<Self::Item>>,
🔬This is a nightly-only experimental API. (
iterator_try_reduce
#87053)通过重复应用 Reduce 操作,将元素归约为单个元素。
如果闭包返回失败,则失败会立即传播给调用者。 Read more
source§fn try_find<F, R>(
&mut self,
f: F
) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere
Self: Sized,
F: FnMut(&Self::Item) -> R,
R: Try<Output = bool>,
<R as Try>::Residual: Residual<Option<Self::Item>>,
fn try_find<F, R>( &mut self, f: F ) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere Self: Sized, F: FnMut(&Self::Item) -> R, R: Try<Output = bool>, <R as Try>::Residual: Residual<Option<Self::Item>>,
🔬This is a nightly-only experimental API. (
try_find
#63178)将函数应用于迭代器的元素,并返回第一个为 true 的结果或第一个错误。 Read more
1.6.0 · source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where
B: Ord,
Self: Sized,
F: FnMut(&Self::Item) -> B,
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where B: Ord, Self: Sized, F: FnMut(&Self::Item) -> B,
返回给出指定函数最大值的元素。 Read more
1.15.0 · source§fn max_by<F>(self, compare: F) -> Option<Self::Item>where
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
fn max_by<F>(self, compare: F) -> Option<Self::Item>where Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> Ordering,
返回给出相对于指定比较函数的最大值的元素。 Read more
1.6.0 · source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where
B: Ord,
Self: Sized,
F: FnMut(&Self::Item) -> B,
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where B: Ord, Self: Sized, F: FnMut(&Self::Item) -> B,
返回给出指定函数中最小值的元素。 Read more
1.15.0 · source§fn min_by<F>(self, compare: F) -> Option<Self::Item>where
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
fn min_by<F>(self, compare: F) -> Option<Self::Item>where Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> Ordering,
返回给出相对于指定比较函数的最小值的元素。 Read more
source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Sized + Iterator<Item = (A, B)>,
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where FromA: Default + Extend<A>, FromB: Default + Extend<B>, Self: Sized + Iterator<Item = (A, B)>,
将成对的迭代器转换为一对容器。 Read more
1.36.0 · source§fn copied<'a, T>(self) -> Copied<Self> ⓘwhere
T: 'a + Copy,
Self: Sized + Iterator<Item = &'a T>,
fn copied<'a, T>(self) -> Copied<Self> ⓘwhere T: 'a + Copy, Self: Sized + Iterator<Item = &'a T>,
创建一个迭代器,该迭代器将复制其所有元素。 Read more
source§fn cloned<'a, T>(self) -> Cloned<Self> ⓘwhere
T: 'a + Clone,
Self: Sized + Iterator<Item = &'a T>,
fn cloned<'a, T>(self) -> Cloned<Self> ⓘwhere T: 'a + Clone, Self: Sized + Iterator<Item = &'a T>,
创建一个迭代器,该迭代器将克隆所有元素。 Read more
source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N> ⓘwhere
Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N> ⓘwhere Self: Sized,
🔬This is a nightly-only experimental API. (
iter_array_chunks
#100450)一次返回迭代器的
N
个元素的迭代器。 Read more1.11.0 · source§fn product<P>(self) -> Pwhere
Self: Sized,
P: Product<Self::Item>,
fn product<P>(self) -> Pwhere Self: Sized, P: Product<Self::Item>,
遍历整个迭代器,将所有元素相乘 Read more
source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere Self: Sized, I: IntoIterator, F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
🔬This is a nightly-only experimental API. (
iter_order_by
#64295)1.5.0 · source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Self: Sized,
fn partial_cmp<I>(self, other: I) -> Option<Ordering>where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>, Self: Sized,
Lexicographically 将此
Iterator
的 PartialOrd
元素与另一个 PartialOrd
的元素进行比较。
比较的工作方式类似于短路评估,返回结果而不比较其余元素。
一旦可以确定订单,评估就会停止并返回结果。 Read moresource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where Self: Sized, I: IntoIterator, F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
🔬This is a nightly-only experimental API. (
iter_order_by
#64295)1.5.0 · source§fn eq<I>(self, other: I) -> boolwhere
I: IntoIterator,
Self::Item: PartialEq<<I as IntoIterator>::Item>,
Self: Sized,
fn eq<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialEq<<I as IntoIterator>::Item>, Self: Sized,
source§fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere Self: Sized, I: IntoIterator, F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
🔬This is a nightly-only experimental API. (
iter_order_by
#64295)1.5.0 · source§fn ne<I>(self, other: I) -> boolwhere
I: IntoIterator,
Self::Item: PartialEq<<I as IntoIterator>::Item>,
Self: Sized,
fn ne<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialEq<<I as IntoIterator>::Item>, Self: Sized,
1.5.0 · source§fn lt<I>(self, other: I) -> boolwhere
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Self: Sized,
fn lt<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>, Self: Sized,
1.5.0 · source§fn le<I>(self, other: I) -> boolwhere
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Self: Sized,
fn le<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>, Self: Sized,
1.5.0 · source§fn gt<I>(self, other: I) -> boolwhere
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Self: Sized,
fn gt<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>, Self: Sized,
1.5.0 · source§fn ge<I>(self, other: I) -> boolwhere
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Self: Sized,
fn ge<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>, Self: Sized,
source§fn is_sorted_by<F>(self, compare: F) -> boolwhere
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,
fn is_sorted_by<F>(self, compare: F) -> boolwhere Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,
🔬This is a nightly-only experimental API. (
is_sorted
#53485)检查此迭代器的元素是否使用给定的比较器函数进行排序。 Read more
source§fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere
Self: Sized,
F: FnMut(Self::Item) -> K,
K: PartialOrd<K>,
fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere Self: Sized, F: FnMut(Self::Item) -> K, K: PartialOrd<K>,
🔬This is a nightly-only experimental API. (
is_sorted
#53485)检查此迭代器的元素是否使用给定的键提取函数进行排序。 Read more
impl<T> FusedIterator for IterMut<'_, T>
impl<T> Send for IterMut<'_, T>where T: Send,
impl<T> Sync for IterMut<'_, T>where T: Sync,
impl<T> TrustedLen for IterMut<'_, T>
Auto Trait Implementations§
impl<'a, T> RefUnwindSafe for IterMut<'a, T>where T: RefUnwindSafe,
impl<'a, T> Unpin for IterMut<'a, T>
impl<'a, T> !UnwindSafe for IterMut<'a, T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
从拥有的值中借用。 Read more