GetDisjointMutIndex in core::slice - Rust
Description: A helper trait for `<[T]>::get_disjoint_mut()`.

## GetDisjointMutIndex

# 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.

## Required Methods§

Source

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

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

## 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 GetDisjointMutIndex for usize

Source§

### impl GetDisjointMutIndex for core::ops::Range<usize>

Source§

### impl GetDisjointMutIndex for core::ops::RangeInclusive<usize>

Source§

### impl GetDisjointMutIndex for core::range::Range<usize>

Source§

### impl GetDisjointMutIndex for core::range::RangeInclusive<usize>