Trait soa_derive::SoAIndex
source · pub trait SoAIndex<T>: Sealed {
type RefOutput;
// Required methods
fn get(self, soa: T) -> Option<Self::RefOutput>;
unsafe fn get_unchecked(self, soa: T) -> Self::RefOutput;
fn index(self, soa: T) -> Self::RefOutput;
}
Expand description
Helper trait used for indexing operations.
Inspired by std::slice::SliceIndex
.
Required Associated Types§
Required Methods§
sourcefn get(self, soa: T) -> Option<Self::RefOutput>
fn get(self, soa: T) -> Option<Self::RefOutput>
Returns the reference output in this location if in bounds, None
otherwise.
sourceunsafe fn get_unchecked(self, soa: T) -> Self::RefOutput
unsafe fn get_unchecked(self, soa: T) -> Self::RefOutput
Returns the reference output in this location without performing any bounds check.
Safety
The index must be in bounds.