Struct core::ops::RangeFrom

1.0.0 · source ·
pub struct RangeFrom<Idx> {
    pub start: Idx,
}
Expand description

范围仅包括 (start..) 以下的范围。

RangeFrom start.. 包含 x >= start 的所有值。

Note: Iterator 实现中的溢出 (当所包含的数据类型达到其数值限制时) 允许 panic,自动换行或饱和。 此行为由 Step trait 的实现定义。 对于原始整数,这遵循正常规则,并遵守溢出检查配置文件 (调试中为 panic,释放中为包装)。 还要注意,溢出发生的时间比您想像的要早:溢出发生在 next 的调用中,该调用会产生最大值,因为必须将范围设置为产生下一个值的状态。

Examples

start.. 语法是 RangeFrom

assert_eq!((2..), std::ops::RangeFrom { start: 2 });
assert_eq!(2 + 3 + 4, (2..).take(3).sum());
Run
let arr = [0, 1, 2, 3, 4];
assert_eq!(arr[ ..  ], [0, 1, 2, 3, 4]);
assert_eq!(arr[ .. 3], [0, 1, 2      ]);
assert_eq!(arr[ ..=3], [0, 1, 2, 3   ]);
assert_eq!(arr[1..  ], [   1, 2, 3, 4]); // 这是 `RangeFrom`
assert_eq!(arr[1.. 3], [   1, 2      ]);
assert_eq!(arr[1..=3], [   1, 2, 3   ]);
Run

Fields§

§start: Idx

范围的下限 (包括)。

Implementations§

source§

impl<Idx: PartialOrd<Idx>> RangeFrom<Idx>

1.35.0 · source

pub fn contains<U>(&self, item: &U) -> boolwhere Idx: PartialOrd<U>, U: ?Sized + PartialOrd<Idx>,

如果范围中包含 item,则返回 true

Examples
assert!(!(3..).contains(&2));
assert!( (3..).contains(&3));
assert!( (3..).contains(&1_000_000_000));

assert!( (0.0..).contains(&0.5));
assert!(!(0.0..).contains(&f32::NAN));
assert!(!(f32::NAN..).contains(&0.5));
Run

Trait Implementations§

source§

impl<Idx: Clone> Clone for RangeFrom<Idx>

source§

fn clone(&self) -> RangeFrom<Idx>

返回值的副本。 Read more
source§

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

source 执行复制分配。 Read more
source§

impl<Idx: Debug> Debug for RangeFrom<Idx>

source§

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

使用给定的格式化程序格式化该值。 Read more
source§

impl<Idx: Hash> Hash for RangeFrom<Idx>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

将该值输入给定的 HasherRead more
1.3.0 · source§

fn hash_slice<H: Hasher>(data: &[Self], state: &mut H)where Self: Sized,

将这种类型的切片送入给定的 Hasher 中。 Read more
1.47.0 · source§

impl Index<RangeFrom<usize>> for CStr

§

type Output = CStr

索引后返回的类型。
source§

fn index(&self, index: RangeFrom<usize>) -> &CStr

执行索引 (container[index]) 操作。 Read more
source§

impl<A: Step> Iterator for RangeFrom<A>

§

type Item = A

被迭代的元素的类型。
source§

fn next(&mut self) -> Option<A>

推进迭代器并返回下一个值。 Read more
source§

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

返回迭代器剩余长度的界限。 Read more
source§

fn nth(&mut self, n: usize) -> Option<A>

返回迭代器的第 n 个元素。 Read more
source§

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 more
source§

fn count(self) -> usizewhere Self: Sized,

消耗迭代器,计算迭代次数并返回它。 Read more
source§

fn last(self) -> Option<Self::Item>where Self: Sized,

消耗迭代器,返回最后一个元素。 Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by #77404)
通过 n 元素使迭代器前进。 Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self> where Self: Sized,

创建一个从同一点开始的迭代器,但在每次迭代时以给定的数量逐步执行。 Read more
source§

fn chain<U>(self, other: U) -> Chain<Self, U::IntoIter> where Self: Sized, U: IntoIterator<Item = Self::Item>,

接受两个迭代器,并依次在两个迭代器上创建一个新的迭代器。 Read more
source§

fn zip<U>(self, other: U) -> Zip<Self, U::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,

🔬This is a nightly-only experimental API. (iter_intersperse #79524)
创建一个新的迭代器,该迭代器将 separator 生成的项放在原始迭代器的相邻项之间。 Read more
source§

fn map<B, F>(self, f: F) -> Map<Self, F> where Self: Sized, F: FnMut(Self::Item) -> B,

获取一个闭包并创建一个迭代器,该迭代器在每个元素上调用该闭包。 Read more
1.21.0 · source§

fn for_each<F>(self, f: F)where Self: Sized, F: FnMut(Self::Item),

在迭代器的每个元素上调用一个闭包。 Read more
source§

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>,

创建一个同时过滤和映射的迭代器。 Read more
source§

fn enumerate(self) -> Enumerate<Self> where Self: Sized,

创建一个迭代器,该迭代器给出当前迭代次数以及下一个值。 Read more
source§

fn peekable(self) -> Peekable<Self> where Self: Sized,

创建一个迭代器,它可以使用 peekpeek_mut 方法查看迭代器的下一个元素而不消耗它。有关更多信息,请参见他们的文档。 Read more
source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where Self: Sized, P: FnMut(&Self::Item) -> bool,

创建一个迭代器,该迭代器基于谓词 skip 元素。 Read more
source§

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>,

创建一个迭代器,该迭代器均基于谓词和映射生成元素。 Read more
source§

fn skip(self, n: usize) -> Skip<Self> where Self: Sized,

创建一个跳过前 n 个元素的迭代器。 Read more
source§

fn take(self, n: usize) -> Take<Self> where Self: Sized,

创建一个迭代器,它产生第一个 n 元素,如果底层迭代器提前结束,则产生更少的元素。 Read more
source§

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>,

一个迭代器适配器,它与 fold 一样保存内部状态,但与 fold 不同,它生成一个新的迭代器。 Read more
source§

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 fuse(self) -> Fuse<Self> where Self: Sized,

创建一个迭代器,该迭代器在第一个 None 之后结束。 Read more
source§

fn inspect<F>(self, f: F) -> Inspect<Self, F> where Self: Sized, F: FnMut(&Self::Item),

对迭代器的每个元素执行某些操作,将值传递给它。 Read more
source§

fn by_ref(&mut self) -> &mut Selfwhere Self: Sized,

借用一个迭代器,而不是使用它。 Read more
source§

fn collect<B: FromIterator<Self::Item>>(self) -> Bwhere Self: Sized,

将迭代器转换为集合。 Read more
source§

fn collect_into<E: Extend<Self::Item>>(self, collection: &mut E) -> &mut Ewhere 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,

消耗一个迭代器,从中创建两个集合。 Read more
source§

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)
检查此迭代器的元素是否根据给定的谓词进行了分区,以便所有返回 true 的元素都在所有返回 false 的元素之前。 Read more
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>,

一个迭代器方法,它只要成功返回就应用函数,并产生单个最终值。 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 = ()>,

一个迭代器方法,该方法将一个容易犯错的函数应用于迭代器中的每个项,在第一个错误处停止并返回该错误。 Read more
source§

fn fold<B, F>(self, init: B, f: F) -> Bwhere Self: Sized, F: FnMut(B, Self::Item) -> B,

通过应用操作将每个元素 fold 到一个累加器中,返回最终结果。 Read more
1.51.0 · source§

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::Output>>>::TryTypewhere Self: Sized, F: FnMut(Self::Item, Self::Item) -> R, R: Try<Output = Self::Item>, R::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce #87053)
通过重复应用 Reduce 操作,将元素归约为单个元素。 如果闭包返回失败,则失败会立即传播给调用者。 Read more
source§

fn all<F>(&mut self, f: F) -> boolwhere Self: Sized, F: FnMut(Self::Item) -> bool,

测试迭代器的每个元素是否与谓词匹配。 Read more
source§

fn any<F>(&mut self, f: F) -> boolwhere Self: Sized, F: FnMut(Self::Item) -> bool,

测试迭代器的任何元素是否与谓词匹配。 Read more
source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where Self: Sized, P: FnMut(&Self::Item) -> bool,

搜索满足谓词的迭代器的元素。 Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>where Self: Sized, F: FnMut(Self::Item) -> Option<B>,

将函数应用于迭代器的元素,并返回第一个非 None 的结果。 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::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find #63178)
将函数应用于迭代器的元素,并返回第一个为 true 的结果或第一个错误。 Read more
source§

fn position<P>(&mut self, predicate: P) -> Option<usize>where Self: Sized, P: FnMut(Self::Item) -> bool,

在迭代器中搜索元素,并返回其索引。 Read more
1.6.0 · source§

fn max_by_key<B: Ord, F>(self, f: F) -> Option<Self::Item>where 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,

返回给出相对于指定比较函数的最大值的元素。 Read more
1.6.0 · source§

fn min_by_key<B: Ord, F>(self, f: F) -> Option<Self::Item>where 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,

返回给出相对于指定比较函数的最小值的元素。 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)>,

将成对的迭代器转换为一对容器。 Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self> where Self: Sized + Iterator<Item = &'a T>, T: Copy + 'a,

创建一个迭代器,该迭代器将复制其所有元素。 Read more
source§

fn cloned<'a, T>(self) -> Cloned<Self> where Self: Sized + Iterator<Item = &'a T>, T: Clone + 'a,

创建一个迭代器,该迭代器将克隆所有元素。 Read more
source§

fn cycle(self) -> Cycle<Self> where Self: Sized + Clone,

不断重复的迭代器。 Read more
source§

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 more
1.11.0 · source§

fn sum<S>(self) -> Swhere Self: Sized, S: Sum<Self::Item>,

对迭代器的元素求和。 Read more
1.11.0 · source§

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::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by #64295)
字典顺序 根据指定的比较函数将这个 Iterator 的元素与另一个 Iterator 的元素进行比较。 Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>where I: IntoIterator, Self::Item: PartialOrd<I::Item>, Self: Sized,

Lexicographically 将此 IteratorPartialOrd 元素与另一个 PartialOrd 的元素进行比较。 比较的工作方式类似于短路评估,返回结果而不比较其余元素。 一旦可以确定订单,评估就会停止并返回结果。 Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where Self: Sized, I: IntoIterator, F: FnMut(Self::Item, I::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by #64295)
字典顺序 根据指定的比较函数将这个 Iterator 的元素与另一个 Iterator 的元素进行比较。 Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialEq<I::Item>, Self: Sized,

确定此 Iterator 的元素是否与另一个元素相同。 Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere Self: Sized, I: IntoIterator, F: FnMut(Self::Item, I::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by #64295)
关于指定的相等函数,确定 Iterator 的元素是否与另一个元素相等。 Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialEq<I::Item>, Self: Sized,

确定此 Iterator 的元素是否不等于另一个的元素。 Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialOrd<I::Item>, Self: Sized,

确定此 Iterator 的元素是否比另一个元素少 按字典顺序Read more
1.5.0 · source§

fn le<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialOrd<I::Item>, Self: Sized,

确定此 Iterator 的元素是否 按字典顺序 小于或等于另一个元素。 Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialOrd<I::Item>, Self: Sized,

确定此 Iterator 的元素是否大于另一个元素的 按字典顺序Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> boolwhere I: IntoIterator, Self::Item: PartialOrd<I::Item>, Self: Sized,

确定此 Iterator 的元素是否 按字典顺序 大于或等于另一个元素。 Read more
source§

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,

🔬This is a nightly-only experimental API. (is_sorted #53485)
检查此迭代器的元素是否使用给定的键提取函数进行排序。 Read more
source§

impl<Idx: PartialEq> PartialEq<RangeFrom<Idx>> for RangeFrom<Idx>

source§

fn eq(&self, other: &RangeFrom<Idx>) -> bool

此方法测试 selfother 值是否相等,并由 == 使用。
source§

fn ne(&self, other: &Rhs) -> bool

此方法测试 !=。 默认实现几乎总是足够的,并且不应在没有充分理由的情况下被覆盖。
1.28.0 · source§

impl<T> RangeBounds<T> for RangeFrom<&T>

source§

fn start_bound(&self) -> Bound<&T>

开始索引绑定。 Read more
source§

fn end_bound(&self) -> Bound<&T>

结束索引绑定。 Read more
1.35.0 · source§

fn contains<U>(&self, item: &U) -> boolwhere T: PartialOrd<U>, U: ?Sized + PartialOrd<T>,

如果范围中包含 item,则返回 trueRead more
1.28.0 · source§

impl<T> RangeBounds<T> for RangeFrom<T>

source§

fn start_bound(&self) -> Bound<&T>

开始索引绑定。 Read more
source§

fn end_bound(&self) -> Bound<&T>

结束索引绑定。 Read more
1.35.0 · source§

fn contains<U>(&self, item: &U) -> boolwhere T: PartialOrd<U>, U: ?Sized + PartialOrd<T>,

如果范围中包含 item,则返回 trueRead more
1.15.0 (const: unstable) · source§

impl<T> SliceIndex<[T]> for RangeFrom<usize>

§

type Output = [T]

方法返回的输出类型。
const: unstable · source§

fn get(self, slice: &[T]) -> Option<&[T]>

🔬This is a nightly-only experimental API. (slice_index_methods)
如果在边界内,则返回此位置输出的共享引用。
const: unstable · source§

fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]>

🔬This is a nightly-only experimental API. (slice_index_methods)
如果在边界内,则对此位置的输出返回一个可变引用。
const: unstable · source§

unsafe fn get_unchecked(self, slice: *const [T]) -> *const [T]

🔬This is a nightly-only experimental API. (slice_index_methods)
返回此位置输出的共享引用,而不执行任何边界检查。 即使未使用所得的引用,使用越界索引或悬垂的 slice 指针调用此方法也是 [undefined 行为]
const: unstable · source§

unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut [T]

🔬This is a nightly-only experimental API. (slice_index_methods)
返回此位置输出的变量引用,而不执行任何边界检查。 即使未使用所得的引用,使用越界索引或悬垂的 slice 指针调用此方法也是 [undefined 行为]
const: unstable · source§

fn index(self, slice: &[T]) -> &[T]

🔬This is a nightly-only experimental API. (slice_index_methods)
返回此位置输出的共享引用,如果越界则会触发 panic。
const: unstable · source§

fn index_mut(self, slice: &mut [T]) -> &mut [T]

🔬This is a nightly-only experimental API. (slice_index_methods)
返回此位置输出的变量引用,如果越界则会触发 panic。
1.20.0 (const: unstable) · source§

impl SliceIndex<str> for RangeFrom<usize>

使用语法 &self[begin ..]&mut self[begin ..] 实现子字符串切片。

从字节范围 [begin, len) 中返回给定字符串的切片。 相当于 &self[begin .. len]&mut self[begin .. len]

此运算为 O(1)。

在 1.20.0 之前,IndexIndexMut 的直接实现仍支持这些索引操作。

Panics

如果 begin 没有指向字符的起始字节偏移量 (由 is_char_boundary 定义),或者 begin > len,就会出现 panics。

§

type Output = str

方法返回的输出类型。
const: unstable · source§

fn get(self, slice: &str) -> Option<&Self::Output>

🔬This is a nightly-only experimental API. (slice_index_methods)
如果在边界内,则返回此位置输出的共享引用。
const: unstable · source§

fn get_mut(self, slice: &mut str) -> Option<&mut Self::Output>

🔬This is a nightly-only experimental API. (slice_index_methods)
如果在边界内,则对此位置的输出返回一个可变引用。
const: unstable · source§

unsafe fn get_unchecked(self, slice: *const str) -> *const Self::Output

🔬This is a nightly-only experimental API. (slice_index_methods)
返回此位置输出的共享引用,而不执行任何边界检查。 即使未使用所得的引用,使用越界索引或悬垂的 slice 指针调用此方法也是 [undefined 行为]
const: unstable · source§

unsafe fn get_unchecked_mut(self, slice: *mut str) -> *mut Self::Output

🔬This is a nightly-only experimental API. (slice_index_methods)
返回此位置输出的变量引用,而不执行任何边界检查。 即使未使用所得的引用,使用越界索引或悬垂的 slice 指针调用此方法也是 [undefined 行为]
const: unstable · source§

fn index(self, slice: &str) -> &Self::Output

🔬This is a nightly-only experimental API. (slice_index_methods)
返回此位置输出的共享引用,如果越界则会触发 panic。
const: unstable · source§

fn index_mut(self, slice: &mut str) -> &mut Self::Output

🔬This is a nightly-only experimental API. (slice_index_methods)
返回此位置输出的变量引用,如果越界则会触发 panic。
source§

impl<Idx: Eq> Eq for RangeFrom<Idx>

1.26.0 · source§

impl<A: Step> FusedIterator for RangeFrom<A>

source§

impl<T> OneSidedRange<T> for RangeFrom<T>where Self: RangeBounds<T>,

source§

impl<Idx> StructuralEq for RangeFrom<Idx>

source§

impl<Idx> StructuralPartialEq for RangeFrom<Idx>

source§

impl<A: TrustedStep> TrustedLen for RangeFrom<A>

Auto Trait Implementations§

§

impl<Idx> RefUnwindSafe for RangeFrom<Idx>where Idx: RefUnwindSafe,

§

impl<Idx> Send for RangeFrom<Idx>where Idx: Send,

§

impl<Idx> Sync for RangeFrom<Idx>where Idx: Sync,

§

impl<Idx> Unpin for RangeFrom<Idx>where Idx: Unpin,

§

impl<Idx> UnwindSafe for RangeFrom<Idx>where Idx: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

获取 selfTypeIdRead more
source§

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

source§

fn borrow(&self) -> &T

从拥有的值中一成不变地借用。 Read more
source§

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

source§

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

从拥有的值中借用。 Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

返回未更改的参数。

source§

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

source§

fn into(self) -> U

调用 U::from(self)

也就是说,这种转换是 From<T> for U 实现选择执行的任何操作。

source§

impl<I> IntoIterator for Iwhere I: Iterator,

§

type Item = <I as Iterator>::Item

被迭代的元素的类型。
§

type IntoIter = I

我们将其变成哪种迭代器?
const: unstable · source§

fn into_iter(self) -> I

从一个值创建一个迭代器。 Read more
source§

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

§

type Error = Infallible

发生转换错误时返回的类型。
source§

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

执行转换。
source§

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

§

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

发生转换错误时返回的类型。
source§

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

执行转换。