Skip to main content

TrustedRandomAccessNoCoerce

Trait TrustedRandomAccessNoCoerce 

Source
#[doc(hidden)]
pub unsafe trait TrustedRandomAccessNoCoerce: Sized { const MAY_HAVE_SIDE_EFFECT: bool; // Provided method fn size(&self) -> usize where Self: Iterator { ... } }
🔬This is a nightly-only experimental API. (trusted_random_access)
Expand description

Like TrustedRandomAccess but without any of the requirements / guarantees around coercions to supertypes after __iterator_get_unchecked (they aren’t allowed here!), and without the requirement that subtypes / supertypes implement TrustedRandomAccessNoCoerce.

This trait was created in PR #85874 to fix soundness issue #85873 without performance regressions. It is subject to change as we might want to build a more generally useful (for performance optimizations) and more sophisticated trait or trait hierarchy that replaces or extends TrustedRandomAccess and TrustedRandomAccessNoCoerce.

Required Associated Constants§

Source

const MAY_HAVE_SIDE_EFFECT: bool

🔬This is a nightly-only experimental API. (trusted_random_access)

true if getting an iterator element may have side effects. Remember to take inner iterators into account.

Provided Methods§

Source

fn size(&self) -> usize
where Self: Iterator,

🔬This is a nightly-only experimental API. (trusted_random_access)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl TrustedRandomAccessNoCoerce for Bytes<'_>

Source§

impl TrustedRandomAccessNoCoerce for Range<NonZero<u8>>

Source§

impl TrustedRandomAccessNoCoerce for Range<NonZero<u16>>

Source§

impl TrustedRandomAccessNoCoerce for Range<NonZero<u32>>

Source§

impl TrustedRandomAccessNoCoerce for Range<NonZero<u64>>

Source§

impl TrustedRandomAccessNoCoerce for Range<NonZero<usize>>

Source§

impl TrustedRandomAccessNoCoerce for Range<i8>

Source§

impl TrustedRandomAccessNoCoerce for Range<i16>

Source§

impl TrustedRandomAccessNoCoerce for Range<i32>

Source§

impl TrustedRandomAccessNoCoerce for Range<i64>

Source§

impl TrustedRandomAccessNoCoerce for Range<isize>

Source§

impl TrustedRandomAccessNoCoerce for Range<u8>

Source§

impl TrustedRandomAccessNoCoerce for Range<u16>

Source§

impl TrustedRandomAccessNoCoerce for Range<u32>

Source§

impl TrustedRandomAccessNoCoerce for Range<u64>

Source§

impl TrustedRandomAccessNoCoerce for Range<usize>

Source§

impl TrustedRandomAccessNoCoerce for RangeIter<i8>

Source§

impl TrustedRandomAccessNoCoerce for RangeIter<i16>

Source§

impl TrustedRandomAccessNoCoerce for RangeIter<i32>

Source§

impl TrustedRandomAccessNoCoerce for RangeIter<i64>

Source§

impl TrustedRandomAccessNoCoerce for RangeIter<isize>

Source§

impl TrustedRandomAccessNoCoerce for RangeIter<u8>

Source§

impl TrustedRandomAccessNoCoerce for RangeIter<u16>

Source§

impl TrustedRandomAccessNoCoerce for RangeIter<u32>

Source§

impl TrustedRandomAccessNoCoerce for RangeIter<u64>

Source§

impl TrustedRandomAccessNoCoerce for RangeIter<usize>

Source§

impl TrustedRandomAccessNoCoerce for ToCasefold

Source§

impl TrustedRandomAccessNoCoerce for ToLowercase

Source§

impl TrustedRandomAccessNoCoerce for ToTitlecase

Source§

impl TrustedRandomAccessNoCoerce for ToUppercase

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for Chunks<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for ChunksExact<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for ChunksExactMut<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for ChunksMut<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for std::slice::Iter<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for std::slice::IterMut<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for RChunks<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for RChunksExact<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for RChunksExactMut<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for RChunksMut<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for Windows<'a, T>

Source§

impl<A, B> TrustedRandomAccessNoCoerce for Zip<A, B>

Source§

impl<I, F> TrustedRandomAccessNoCoerce for Map<I, F>

Source§

impl<I> TrustedRandomAccessNoCoerce for Cloned<I>

Source§

impl<I> TrustedRandomAccessNoCoerce for Copied<I>

Source§

const MAY_HAVE_SIDE_EFFECT: bool = I::MAY_HAVE_SIDE_EFFECT

Source§

impl<I> TrustedRandomAccessNoCoerce for Enumerate<I>

Source§

const MAY_HAVE_SIDE_EFFECT: bool = I::MAY_HAVE_SIDE_EFFECT

Source§

impl<I> TrustedRandomAccessNoCoerce for Fuse<I>

Source§

const MAY_HAVE_SIDE_EFFECT: bool = I::MAY_HAVE_SIDE_EFFECT

Source§

impl<I> TrustedRandomAccessNoCoerce for Skip<I>

Source§

const MAY_HAVE_SIDE_EFFECT: bool = I::MAY_HAVE_SIDE_EFFECT

Source§

impl<T, A> TrustedRandomAccessNoCoerce for std::vec::IntoIter<T, A>
where A: Allocator, T: NonDrop,

Source§

impl<T, const N: usize> TrustedRandomAccessNoCoerce for ArrayWindows<'_, T, N>

Source§

impl<T, const N: usize> TrustedRandomAccessNoCoerce for std::array::IntoIter<T, N>
where T: NonDrop,

Source§

impl<T> TrustedRandomAccessNoCoerce for std::collections::vec_deque::Iter<'_, T>

Source§

impl<T> TrustedRandomAccessNoCoerce for std::collections::vec_deque::IterMut<'_, T>