pub trait CubeIndex: CubeType<ExpandType: CubeIndexExpand<Output = <Self::Output as CubeType>::ExpandType>> {
type Output: CubeType;
// Provided methods
fn cube_idx(&self, _i: u32) -> &Self::Output { ... }
fn expand_index(
scope: &mut Scope,
array: Self::ExpandType,
index: ExpandElementTyped<u32>,
) -> <Self::Output as CubeType>::ExpandType { ... }
fn expand_index_unchecked(
scope: &mut Scope,
array: Self::ExpandType,
index: ExpandElementTyped<u32>,
) -> <Self::Output as CubeType>::ExpandType { ... }
}
Expand description
Fake indexation so we can rewrite indexes into scalars as calls to this fake function in the non-expanded function
Required Associated Types§
Provided Methods§
fn cube_idx(&self, _i: u32) -> &Self::Output
fn expand_index( scope: &mut Scope, array: Self::ExpandType, index: ExpandElementTyped<u32>, ) -> <Self::Output as CubeType>::ExpandType
fn expand_index_unchecked( scope: &mut Scope, array: Self::ExpandType, index: ExpandElementTyped<u32>, ) -> <Self::Output as CubeType>::ExpandType
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.