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 CaseMappingIter

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 Iter<'a, T>

Source§

impl<'a, T> TrustedRandomAccessNoCoerce for 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, const N: usize> TrustedRandomAccessNoCoerce for IntoIter<T, N>
where T: NonDrop,

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