Trait sgx_tstd::iter::TrustedLen [−][src]
pub unsafe trait TrustedLen: Iterator { }
🔬 This is a nightly-only experimental API. (
trusted_len
)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 be
usize::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.
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<A> TrustedLen for Repeat<A> where
A: Clone,impl TrustedLen for RangeInclusive<isize>
impl<I> TrustedLen for Take<I> where
I: TrustedLen,impl<'a, A> TrustedLen for sgx_tstd::option::IterMut<'a, A>
impl TrustedLen for Range<u16>
impl<'a, T> TrustedLen for sgx_tstd::slice::Iter<'a, T>
impl TrustedLen for RangeInclusive<i64>
impl<A> TrustedLen for sgx_tstd::result::IntoIter<A>
impl<I> TrustedLen for Enumerate<I> where
I: TrustedLen,impl TrustedLen for Range<i64>
impl TrustedLen for RangeInclusive<i8>
impl<'a, A> TrustedLen for sgx_tstd::option::Iter<'a, A>
impl<T> TrustedLen for Once<T>
impl<'a, T> TrustedLen for ExactChunksMut<'a, T>
impl<'a, I> TrustedLen for &'a mut I where
I: TrustedLen + ?Sized,impl TrustedLen for Range<u8>
impl TrustedLen for RangeInclusive<i16>
impl<'a, A> TrustedLen for sgx_tstd::result::Iter<'a, A>
impl TrustedLen for RangeInclusive<u16>
impl<B, I, F> TrustedLen for Map<I, F> where
F: FnMut(<I as Iterator>::Item) -> B,
I: TrustedLen,impl<'a, T> TrustedLen for Windows<'a, T>
impl<T> TrustedLen for Empty<T>
impl TrustedLen for Range<usize>
impl TrustedLen for Range<i32>
impl TrustedLen for Range<u32>
impl TrustedLen for Range<i16>
impl TrustedLen for Range<i8>
impl TrustedLen for RangeInclusive<usize>
impl<I> TrustedLen for Rev<I> where
I: TrustedLen + DoubleEndedIterator,impl<A> TrustedLen for sgx_tstd::option::IntoIter<A>
impl<'a> TrustedLen for Bytes<'a>
impl<'a, T> TrustedLen for ExactChunks<'a, T>
impl<A> TrustedLen for RangeFrom<A> where
A: Step,impl TrustedLen for RangeInclusive<i32>
impl<A, B> TrustedLen for Zip<A, B> where
A: TrustedLen,
B: TrustedLen,impl<A, B> TrustedLen for Chain<A, B> where
A: TrustedLen,
B: TrustedLen<Item = <A as Iterator>::Item>,impl TrustedLen for RangeInclusive<u8>
impl<'a, T> TrustedLen for ChunksMut<'a, T>
impl TrustedLen for RangeInclusive<u32>
impl TrustedLen for Range<isize>
impl<'a, T> TrustedLen for Chunks<'a, T>
impl<'a, T> TrustedLen for sgx_tstd::slice::IterMut<'a, T>
impl TrustedLen for Range<u64>
impl<A, F> TrustedLen for RepeatWith<F> where
F: FnMut() -> A,impl<'a, I, T> TrustedLen for Cloned<I> where
I: TrustedLen<Item = &'a T>,
T: 'a + Clone,impl<'a, A> TrustedLen for sgx_tstd::result::IterMut<'a, A>
impl TrustedLen for RangeInclusive<u64>
impl<T> TrustedLen for sgx_tstd::vec::IntoIter<T>