pub trait SoAIndexMut<T>: Sealed {
    type MutOutput;

    // Required methods
    fn get_mut(self, soa: T) -> Option<Self::MutOutput>;
    unsafe fn get_unchecked_mut(self, soa: T) -> Self::MutOutput;
    fn index_mut(self, soa: T) -> Self::MutOutput;
}
Expand description

Helper trait used for indexing operations returning mutable references. Inspired by std::slice::SliceIndex.

Required Associated Types§

source

type MutOutput

The output for the mutable functions

Required Methods§

source

fn get_mut(self, soa: T) -> Option<Self::MutOutput>

Returns the mutable reference output in this location if in bounds, None otherwise.

source

unsafe fn get_unchecked_mut(self, soa: T) -> Self::MutOutput

Returns the mutable reference output in this location without performing any bounds check.

Safety

The index must be in bounds.

source

fn index_mut(self, soa: T) -> Self::MutOutput

Returns the mutable reference output in this location. Panics if it is not in bounds.

Implementors§