pub trait IndexedSource {
type Item: Copy;
// Required methods
fn len(&self) -> usize;
unsafe fn get_unchecked(&self, i: usize) -> Self::Item;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
A length-known source supporting unchecked indexed reads.
Implemented for &[T] (with T: Copy) and for LaneZip over two IndexedSources.
The kernels in this crate require this trait instead of Iterator so that lane
reads carry no inter-iteration data dependency — the autovectorizer treats each
lane independently.
Required Associated Types§
Required Methods§
Sourceunsafe fn get_unchecked(&self, i: usize) -> Self::Item
unsafe fn get_unchecked(&self, i: usize) -> Self::Item
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".