Skip to main content

SliceOperator

Trait SliceOperator 

Source
pub trait SliceOperator<E: CubePrimitive>: CubeType<ExpandType: SliceOperatorExpand<E>> {
    // Provided methods
    fn slice(&self, start: usize, end: usize) -> &[E] { ... }
    fn slice_mut(&mut self, start: usize, end: usize) -> &mut [E] { ... }
    fn __expand_slice<'infer, 'scope>(
        scope: &'scope Scope,
        this: &'infer <Self as CubeType>::ExpandType,
        start: <usize as CubeType>::ExpandType,
        end: <usize as CubeType>::ExpandType,
    ) -> &'infer <[E] as CubeType>::ExpandType  { ... }
    fn __expand_slice_mut<'infer, 'scope>(
        scope: &'scope Scope,
        this: &'infer mut <Self as CubeType>::ExpandType,
        start: <usize as CubeType>::ExpandType,
        end: <usize as CubeType>::ExpandType,
    ) -> &'infer mut <[E] as CubeType>::ExpandType  { ... }
}

Provided Methods§

Source

fn slice(&self, start: usize, end: usize) -> &[E]

Return a read-only view of all elements comprise between the start and end indices. In checked mode, if the end index is out-of-bound, it is replaced by the length of self.

Source

fn slice_mut(&mut self, start: usize, end: usize) -> &mut [E]

Return a read-write view of all elements comprise between the start and end indices. In checked mode, if the end index is out-of-bound, it is replaced by the length of self.

Source

fn __expand_slice<'infer, 'scope>( scope: &'scope Scope, this: &'infer <Self as CubeType>::ExpandType, start: <usize as CubeType>::ExpandType, end: <usize as CubeType>::ExpandType, ) -> &'infer <[E] as CubeType>::ExpandType

Source

fn __expand_slice_mut<'infer, 'scope>( scope: &'scope Scope, this: &'infer mut <Self as CubeType>::ExpandType, start: <usize as CubeType>::ExpandType, end: <usize as CubeType>::ExpandType, ) -> &'infer mut <[E] 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<E: CubePrimitive> SliceOperator<E> for [E]

Implementors§