SliceOperator

Trait SliceOperator 

Source
pub trait SliceOperator<E: CubePrimitive>: CubeType<ExpandType: SliceOperatorExpand<E>> {
    // Provided methods
    fn slice(&self, start: u32, end: u32) -> Slice<E, ReadOnly>  { ... }
    fn to_slice(&self) -> Slice<E, ReadOnly>  { ... }
    fn __expand_slice(
        scope: &mut Scope,
        this: <Self as CubeType>::ExpandType,
        start: <u32 as CubeType>::ExpandType,
        end: <u32 as CubeType>::ExpandType,
    ) -> <Slice<E, ReadOnly> as CubeType>::ExpandType  { ... }
    fn __expand_to_slice(
        scope: &mut Scope,
        this: <Self as CubeType>::ExpandType,
    ) -> <Slice<E, ReadOnly> as CubeType>::ExpandType  { ... }
}

Provided Methods§

Source

fn slice(&self, start: u32, end: u32) -> Slice<E, ReadOnly>

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 to_slice(&self) -> Slice<E, ReadOnly>

Reinterprete the current type as a read-only slice.

Source

fn __expand_slice( scope: &mut Scope, this: <Self as CubeType>::ExpandType, start: <u32 as CubeType>::ExpandType, end: <u32 as CubeType>::ExpandType, ) -> <Slice<E, ReadOnly> as CubeType>::ExpandType

Source

fn __expand_to_slice( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <Slice<E, ReadOnly> 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: SliceOperator<T>> SliceOperator<T> for &'a L
where &'a L: CubeType<ExpandType = L::ExpandType>,

Source§

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

Implementors§