pub trait MaybeIndexUnchecked<T> {
// Required methods
fn at(&self, id: usize) -> &T;
fn at_mut(&mut self, id: usize) -> &mut T;
fn read(&self, id: usize) -> T;
fn write(&mut self, id: usize, data: T);
}Expand description
Indexing trait that optionally removes bounds checks on GPU targets.
When the unsafe_remove_boundchecks feature is enabled, methods use
unchecked indexing for performance on SPIR-V and CUDA targets.
Otherwise, standard bounds-checked indexing is used.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".