Trait List

Source
pub trait List<T: CubeType>: CubeType<ExpandType: ListExpand<T>> {
    // Required method
    fn __expand_read(
        scope: &mut Scope,
        this: Self::ExpandType,
        index: ExpandElementTyped<u32>,
    ) -> T::ExpandType;

    // Provided method
    fn read(&self, index: u32) -> T { ... }
}
Expand description

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

Required Methods§

Source

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

Provided Methods§

Source

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

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: CubeType, 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: CubeType, 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§