core::slice

Trait GetManyMutIndex

Source
pub unsafe trait GetManyMutIndex: Clone + Sealed {
    // Required methods
    fn is_in_bounds(&self, len: usize) -> bool;
    fn is_overlapping(&self, other: &Self) -> bool;
}
🔬This is a nightly-only experimental API. (get_many_mut_helpers)
Expand description

A helper trait for <[T]>::get_many_mut().

§Safety

If is_in_bounds() returns true and is_overlapping() returns false, it must be safe to index the slice with the indices.

Required Methods§

Source

fn is_in_bounds(&self, len: usize) -> bool

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

Returns true if self is in bounds for len slice elements.

Source

fn is_overlapping(&self, other: &Self) -> bool

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

Returns true if self overlaps with other.

Note that we don’t consider zero-length ranges to overlap at the beginning or the end, but do consider them to overlap in the middle.

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§