Skip to main content

ListMut

Trait ListMut 

Source
pub trait ListMut<T: CubePrimitive>:
    List<T>
    + SliceMutOperator<T>
    + DerefMut<Target = [T]>
    + CubeType<ExpandType: ListMutExpand<T>> {
    // Provided methods
    fn write(&self, index: usize, value: T) { ... }
    fn __expand_write(
        scope: &mut Scope,
        this: <Self as CubeType>::ExpandType,
        index: <usize as CubeType>::ExpandType,
        value: <T as CubeType>::ExpandType,
    ) -> <() as CubeType>::ExpandType { ... }
}
Expand description

Type for which we can read and write values in cube functions. For an immutable version, see List.

Provided Methods§

Source

fn write(&self, index: usize, value: T)

Source

fn __expand_write( scope: &mut Scope, this: <Self as CubeType>::ExpandType, index: <usize as CubeType>::ExpandType, value: <T as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T: CubePrimitive, L: ListMut<T>> ListMut<T> for &'a L
where &'a L: CubeType<ExpandType = L::ExpandType> + DerefMut<Target = [T]>,

Source§

fn write(&self, index: usize, value: T)

Source§

fn __expand_write( scope: &mut Scope, this: Self::ExpandType, index: NativeExpand<usize>, value: T::ExpandType, )

Source§

impl<'a, T: CubePrimitive, L: ListMut<T>> ListMut<T> for &'a mut L
where &'a mut L: CubeType<ExpandType = L::ExpandType> + DerefMut<Target = [T]>,

Source§

fn write(&self, index: usize, value: T)

Source§

fn __expand_write( scope: &mut Scope, this: Self::ExpandType, index: NativeExpand<usize>, value: T::ExpandType, )

Implementors§