Skip to main content

ListMut

Trait ListMut 

Source
pub trait ListMut<T>:
    List<T, Target = [T]>
    + SliceMutOperator<T>
    + DerefMut
    + CubeType{
    // Provided methods
    fn write(&self, index: usize, value: T) { ... }
    fn __expand_write(
        scope: &mut Scope,
        this: Self::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::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, L> ListMut<T> for &'a L
where T: CubePrimitive, L: ListMut<T>, &'a L: CubeType<ExpandType = <L as CubeType>::ExpandType> + DerefMut<Target = [T]>,

Source§

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

Source§

fn __expand_write( scope: &mut Scope, this: <&'a L as CubeType>::ExpandType, index: NativeExpand<usize>, value: <T as CubeType>::ExpandType, )

Source§

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

Source§

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

Source§

fn __expand_write( scope: &mut Scope, this: <&'a mut L as CubeType>::ExpandType, index: NativeExpand<usize>, value: <T as CubeType>::ExpandType, )

Source§

impl<E, N> ListMut<Vector<E, N>> for VirtualTensor<E, N, ReadWrite>
where E: Numeric, N: Size,

Source§

fn __expand_write( scope: &mut Scope, this: VirtualTensorExpand<E, N, ReadWrite>, index: <usize as CubeType>::ExpandType, value: <Vector<E, N> as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType

Implementors§

Source§

impl<E> ListMut<E> for Slice<E, ReadWrite>
where E: CubePrimitive,

Source§

impl<T> ListMut<T> for Array<T>
where T: CubePrimitive,

Source§

impl<T> ListMut<T> for SharedMemory<T>
where T: CubePrimitive,

Source§

impl<T> ListMut<T> for Tensor<T>
where T: CubePrimitive,