1 /// An iterator whose items are random accessible efficiently
5 /// The iterator's .len() and size_hint() must be exact.
6 /// `.len()` must be cheap to call.
8 /// .get_unchecked() must return distinct mutable references for distinct
9 /// indices (if applicable), and must return a valid reference if index is in
12 pub unsafe trait TrustedRandomAccess : ExactSizeIterator {
13 unsafe fn get_unchecked(&mut self, i: usize) -> Self::Item;
14 /// Returns `true` if getting an iterator element may have
15 /// side effects. Remember to take inner iterators into account.
16 fn may_have_side_effect() -> bool;