Trait std::iter::TrustedLen
[−]
[src]
pub unsafe trait TrustedLen: Iterator { }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.
The iterator must produce exactly the number of elements it reported.
Safety
This trait must only be implemented when the contract is upheld.
Consumers of this trait must inspect .size_hint()’s upper bound.
Implementors
impl<T> TrustedLen for std::vec::IntoIter<T>impl<T> TrustedLen for Empty<T>impl<T> TrustedLen for Once<T>impl<'a, I> TrustedLen for &'a mut I where I: TrustedLen + ?Sizedimpl<I> TrustedLen for Rev<I> where I: TrustedLen + DoubleEndedIteratorimpl<'a, I, T> TrustedLen for Cloned<I> where I: TrustedLen<Item=&'a T>,
T: 'a + Cloneimpl<A, B> TrustedLen for Chain<A, B> where A: TrustedLen,
B: TrustedLen<Item=A::Item>impl<A, B> TrustedLen for Zip<A, B> where A: TrustedLen, B: TrustedLenimpl<B, I, F> TrustedLen for Map<I, F> where F: FnMut(I::Item) -> B,
I: TrustedLenimpl<I> TrustedLen for Enumerate<I> where I: TrustedLenimpl<'a, A> TrustedLen for std::option::Iter<'a, A>impl<'a, A> TrustedLen for std::option::IterMut<'a, A>impl<A> TrustedLen for std::option::IntoIter<A>impl<'a, A> TrustedLen for std::result::Iter<'a, A>impl<'a, A> TrustedLen for std::result::IterMut<'a, A>impl<A> TrustedLen for std::result::IntoIter<A>impl<'a, T> TrustedLen for std::slice::Iter<'a, T>impl<'a, T> TrustedLen for std::slice::IterMut<'a, T>impl TrustedLen for std::ops::Range<usize>impl TrustedLen for std::ops::Range<isize>impl TrustedLen for std::ops::Range<u8>impl TrustedLen for std::ops::Range<i8>impl TrustedLen for std::ops::Range<u16>impl TrustedLen for std::ops::Range<i16>impl TrustedLen for std::ops::Range<u32>impl TrustedLen for std::ops::Range<i32>impl TrustedLen for std::ops::Range<i64>impl TrustedLen for std::ops::Range<u64>impl TrustedLen for std::ops::RangeInclusive<usize>impl TrustedLen for std::ops::RangeInclusive<isize>impl TrustedLen for std::ops::RangeInclusive<u8>impl TrustedLen for std::ops::RangeInclusive<i8>impl TrustedLen for std::ops::RangeInclusive<u16>impl TrustedLen for std::ops::RangeInclusive<i16>impl TrustedLen for std::ops::RangeInclusive<u32>impl TrustedLen for std::ops::RangeInclusive<i32>impl TrustedLen for std::ops::RangeInclusive<i64>impl TrustedLen for std::ops::RangeInclusive<u64>