Skip to main content

GetDisjointMutTypedIndex

Trait GetDisjointMutTypedIndex 

Source
pub unsafe trait GetDisjointMutTypedIndex: Sealed {
    // Required methods
    fn is_in_bounds(&self, len: usize) -> bool;
    fn is_overlapping(&self, other: &Self) -> bool;
}
Expand description

A trait for providing safety checks for disjoint mutable indexing.

§Safety

Implementors must ensure that the is_in_bounds and is_overlapping methods correctly implement the safety contract required for safe disjoint mutable access.

Required Methods§

Source

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

Source

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

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.

Implementations on Foreign Types§

Source§

impl<I: IndexType> GetDisjointMutTypedIndex for Range<I>

Source§

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

Source§

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

Source§

impl<I: IndexType> GetDisjointMutTypedIndex for RangeInclusive<I>

Source§

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

Source§

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

Implementors§