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", so this trait is not object safe.

Implementorsยง

Sourceยง

impl TrustedRandomAccessNoCoerce for ToLowercase

Sourceยง

impl TrustedRandomAccessNoCoerce for ToUppercase

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 IterRange<i8>

Sourceยง

impl TrustedRandomAccessNoCoerce for IterRange<i16>

Sourceยง

impl TrustedRandomAccessNoCoerce for IterRange<i32>

Sourceยง

impl TrustedRandomAccessNoCoerce for IterRange<i64>

Sourceยง

impl TrustedRandomAccessNoCoerce for IterRange<isize>

Sourceยง

impl TrustedRandomAccessNoCoerce for IterRange<u8>

Sourceยง

impl TrustedRandomAccessNoCoerce for IterRange<u16>

Sourceยง

impl TrustedRandomAccessNoCoerce for IterRange<u32>

Sourceยง

impl TrustedRandomAccessNoCoerce for IterRange<u64>

Sourceยง

impl TrustedRandomAccessNoCoerce for IterRange<usize>

Sourceยง

impl TrustedRandomAccessNoCoerce for Bytes<'_>

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, T, const N: usize> TrustedRandomAccessNoCoerce for ArrayChunks<'a, T, N>

Sourceยง

impl<'a, T, const N: usize> TrustedRandomAccessNoCoerce for ArrayChunksMut<'a, T, N>

Sourceยง

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

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<I, F> TrustedRandomAccessNoCoerce for Map<I, F>

Sourceยง

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

Sourceยง

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

Sourceยง

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

Sourceยง

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