List

Trait List 

Source
pub trait List<T: CubePrimitive>:
    SliceOperator<T>
    + Lined
    + CubeType<ExpandType: ListExpand<T>> {
    // Provided methods
    fn read(&self, index: u32) -> T { ... }
    fn read_unchecked(&self, index: u32) -> T { ... }
    fn len(&self) -> u32 { ... }
    fn __expand_read(
        scope: &mut Scope,
        this: <Self as CubeType>::ExpandType,
        index: <u32 as CubeType>::ExpandType,
    ) -> <T as CubeType>::ExpandType { ... }
    fn __expand_read_unchecked(
        scope: &mut Scope,
        this: <Self as CubeType>::ExpandType,
        index: <u32 as CubeType>::ExpandType,
    ) -> <T as CubeType>::ExpandType { ... }
    fn __expand_len(
        scope: &mut Scope,
        this: <Self as CubeType>::ExpandType,
    ) -> <u32 as CubeType>::ExpandType { ... }
}
Expand description

Type from which we can read values in cube functions. For a mutable version, see ListMut.

Provided Methods§

Source

fn read(&self, index: u32) -> T

Source

fn read_unchecked(&self, index: u32) -> T

Source

fn len(&self) -> u32

Source

fn __expand_read( scope: &mut Scope, this: <Self as CubeType>::ExpandType, index: <u32 as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType

Source

fn __expand_read_unchecked( scope: &mut Scope, this: <Self as CubeType>::ExpandType, index: <u32 as CubeType>::ExpandType, ) -> <T as CubeType>::ExpandType

Source

fn __expand_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 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.

Implementations on Foreign Types§

Source§

impl<'a, T: CubePrimitive, L: List<T>> List<T> for &'a L
where &'a L: CubeType<ExpandType = L::ExpandType>,

Source§

fn read(&self, index: u32) -> T

Source§

fn __expand_read( scope: &mut Scope, this: Self::ExpandType, index: ExpandElementTyped<u32>, ) -> <T as CubeType>::ExpandType

Source§

impl<'a, T: CubePrimitive, L: List<T>> List<T> for &'a mut L
where &'a mut L: CubeType<ExpandType = L::ExpandType>,

Source§

fn read(&self, index: u32) -> T

Source§

fn __expand_read( scope: &mut Scope, this: Self::ExpandType, index: ExpandElementTyped<u32>, ) -> <T as CubeType>::ExpandType

Implementors§