std::iter::TrustedLen - Rust (original) (raw)
Trait std::iter::TrustedLen [−] [src]
pub unsafe trait TrustedLen: Iterator { }
🔬 This is a nightly-only experimental API. (trusted_len
#37572)
An iterator that reports an accurate length using size_hint.
The iterator reports a size hint where it is either exact (lower bound is equal to upper bound), or the upper bound is None. The upper bound must only be None if the actual iterator length is larger than usize::MAX. In that case, the lower bound must beusize::MAX, resulting in a .size_hint of (usize::MAX, None)
.
The iterator must produce exactly the number of elements it reported or diverge before reaching the end.
This trait must only be implemented when the contract is upheld. Consumers of this trait must inspect .size_hint’s upper bound.
impl TrustedLen for [RangeInclusive](../../std/ops/struct.RangeInclusive.html "struct std::ops::RangeInclusive")<[isize](../primitive.isize.html)>
impl<I> TrustedLen for [Rev](../../std/iter/struct.Rev.html "struct std::iter::Rev")<I> where I: [TrustedLen](../../std/iter/trait.TrustedLen.html "trait std::iter::TrustedLen") + [DoubleEndedIterator](../../std/iter/trait.DoubleEndedIterator.html "trait std::iter::DoubleEndedIterator"),
impl TrustedLen for [Range](../../std/ops/struct.Range.html "struct std::ops::Range")<[i32](../primitive.i32.html)>
impl<'a, T> TrustedLen for std::slice::[Iter](../../std/slice/struct.Iter.html "struct std::slice::Iter")<'a, T>
impl<'a, I> TrustedLen for [&'a mut ](../primitive.reference.html)I where I: [TrustedLen](../../std/iter/trait.TrustedLen.html "trait std::iter::TrustedLen") + ?[Sized](../../std/marker/trait.Sized.html "trait std:📑:Sized"),
impl<T> TrustedLen for [Once](../../std/iter/struct.Once.html "struct std::iter::Once")<T>
impl<'a, A> TrustedLen for std::option::[IterMut](../../std/option/struct.IterMut.html "struct std::option::IterMut")<'a, A>
impl<B, I, F> TrustedLen for [Map](../../std/iter/struct.Map.html "struct std::iter::Map")<I, F> where F: [FnMut](../../std/ops/trait.FnMut.html "trait std::ops::FnMut")(<I as [Iterator](../../std/iter/trait.Iterator.html "trait std::iter::Iterator")>::[Item](../../std/iter/trait.Iterator.html#associatedtype.Item "type std::iter::Iterator::Item")) -> B, I: [TrustedLen](../../std/iter/trait.TrustedLen.html "trait std::iter::TrustedLen"),
impl<A, B> TrustedLen for [Zip](../../std/iter/struct.Zip.html "struct std::iter::Zip")<A, B> where A: [TrustedLen](../../std/iter/trait.TrustedLen.html "trait std::iter::TrustedLen"), B: [TrustedLen](../../std/iter/trait.TrustedLen.html "trait std::iter::TrustedLen"),
impl TrustedLen for [RangeInclusive](../../std/ops/struct.RangeInclusive.html "struct std::ops::RangeInclusive")<[u8](../primitive.u8.html)>
impl TrustedLen for [Range](../../std/ops/struct.Range.html "struct std::ops::Range")<[u16](../primitive.u16.html)>
impl TrustedLen for [RangeInclusive](../../std/ops/struct.RangeInclusive.html "struct std::ops::RangeInclusive")<[i64](../primitive.i64.html)>
impl TrustedLen for [RangeInclusive](../../std/ops/struct.RangeInclusive.html "struct std::ops::RangeInclusive")<[i16](../primitive.i16.html)>
impl<A> TrustedLen for std::result::[IntoIter](../../std/result/struct.IntoIter.html "struct std::result::IntoIter")<A>
impl<I> TrustedLen for [Enumerate](../../std/iter/struct.Enumerate.html "struct std::iter::Enumerate")<I> where I: [TrustedLen](../../std/iter/trait.TrustedLen.html "trait std::iter::TrustedLen"),
impl<'a, T> TrustedLen for std::slice::[IterMut](../../std/slice/struct.IterMut.html "struct std::slice::IterMut")<'a, T>
impl TrustedLen for [RangeInclusive](../../std/ops/struct.RangeInclusive.html "struct std::ops::RangeInclusive")<[u16](../primitive.u16.html)>
impl TrustedLen for [Range](../../std/ops/struct.Range.html "struct std::ops::Range")<[usize](../primitive.usize.html)>
impl TrustedLen for [RangeInclusive](../../std/ops/struct.RangeInclusive.html "struct std::ops::RangeInclusive")<[usize](../primitive.usize.html)>
impl TrustedLen for [RangeInclusive](../../std/ops/struct.RangeInclusive.html "struct std::ops::RangeInclusive")<[i8](../primitive.i8.html)>
impl<'a, I, T> TrustedLen for [Cloned](../../std/iter/struct.Cloned.html "struct std::iter::Cloned")<I> where I: [TrustedLen](../../std/iter/trait.TrustedLen.html "trait std::iter::TrustedLen")<Item = [&'a ](../primitive.reference.html)T>, T: 'a + [Clone](../../std/clone/trait.Clone.html "trait std::clone::Clone"),
impl TrustedLen for [Range](../../std/ops/struct.Range.html "struct std::ops::Range")<[u64](../primitive.u64.html)>
impl<'a, A> TrustedLen for std::result::[IterMut](../../std/result/struct.IterMut.html "struct std::result::IterMut")<'a, A>
impl<'a, A> TrustedLen for std::option::[Iter](../../std/option/struct.Iter.html "struct std::option::Iter")<'a, A>
impl TrustedLen for [Range](../../std/ops/struct.Range.html "struct std::ops::Range")<[i16](../primitive.i16.html)>
impl<I> TrustedLen for [Take](../../std/iter/struct.Take.html "struct std::iter::Take")<I> where I: [TrustedLen](../../std/iter/trait.TrustedLen.html "trait std::iter::TrustedLen"),
impl TrustedLen for [Range](../../std/ops/struct.Range.html "struct std::ops::Range")<[i64](../primitive.i64.html)>
impl<A> TrustedLen for [Repeat](../../std/iter/struct.Repeat.html "struct std::iter::Repeat")<A> where A: [Clone](../../std/clone/trait.Clone.html "trait std::clone::Clone"),
impl TrustedLen for [Range](../../std/ops/struct.Range.html "struct std::ops::Range")<[u8](../primitive.u8.html)>
impl<A, B> TrustedLen for [Chain](../../std/iter/struct.Chain.html "struct std::iter::Chain")<A, B> where A: [TrustedLen](../../std/iter/trait.TrustedLen.html "trait std::iter::TrustedLen"), B: [TrustedLen](../../std/iter/trait.TrustedLen.html "trait std::iter::TrustedLen")<Item = <A as [Iterator](../../std/iter/trait.Iterator.html "trait std::iter::Iterator")>::[Item](../../std/iter/trait.Iterator.html#associatedtype.Item "type std::iter::Iterator::Item")>,
impl<A> TrustedLen for [RangeFrom](../../std/ops/struct.RangeFrom.html "struct std::ops::RangeFrom")<A> where A: [Step](../../std/iter/trait.Step.html "trait std::iter::Step"),
impl<'a, A> TrustedLen for std::result::[Iter](../../std/result/struct.Iter.html "struct std::result::Iter")<'a, A>
impl<'a> TrustedLen for [Bytes](../../std/str/struct.Bytes.html "struct std::str::Bytes")<'a>
impl TrustedLen for [Range](../../std/ops/struct.Range.html "struct std::ops::Range")<[u32](../primitive.u32.html)>
impl<A> TrustedLen for std::option::[IntoIter](../../std/option/struct.IntoIter.html "struct std::option::IntoIter")<A>
impl<T> TrustedLen for [Empty](../../std/iter/struct.Empty.html "struct std::iter::Empty")<T>
impl TrustedLen for [RangeInclusive](../../std/ops/struct.RangeInclusive.html "struct std::ops::RangeInclusive")<[u64](../primitive.u64.html)>
impl TrustedLen for [Range](../../std/ops/struct.Range.html "struct std::ops::Range")<[i8](../primitive.i8.html)>
impl TrustedLen for [RangeInclusive](../../std/ops/struct.RangeInclusive.html "struct std::ops::RangeInclusive")<[u32](../primitive.u32.html)>
impl TrustedLen for [Range](../../std/ops/struct.Range.html "struct std::ops::Range")<[isize](../primitive.isize.html)>
impl TrustedLen for [RangeInclusive](../../std/ops/struct.RangeInclusive.html "struct std::ops::RangeInclusive")<[i32](../primitive.i32.html)>
impl<T> TrustedLen for std::vec::[IntoIter](../../std/vec/struct.IntoIter.html "struct std::vec::IntoIter")<T>