GetDisjointMutIndex in core::slice - Rust (original) (raw)

Trait GetDisjointMutIndex

Source

pub unsafe trait GetDisjointMutIndex: 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_disjoint_mut_helpers)

Expand description

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

§Safety

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

Source

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

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

Source

🔬This is a nightly-only experimental API. (get_disjoint_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.

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Source§

Source§

Source§

Source§

Source§