pub trait IndexUnchecked<T> {
    unsafe fn index_unchecked(&self, index: usize) -> &T;
    unsafe fn index_unchecked_mut(&mut self, index: usize) -> &mut T;
}
Expand description

Index into an array without bounds checking.

The main purpose of this trait is to work around the fact that the regular get_unchecked* methods do not work in in SPIR-V.

Required methods

Returns a reference to the element at index. The equivalent of get_unchecked.

Safety

Behavior is undefined if the index value is greater than or equal to the length of the array.

Returns a mutable reference to the element at index. The equivalent of get_unchecked_mut.

Safety

Behavior is undefined if the index value is greater than or equal to the length of the array.

Implementations on Foreign Types

Implementors