Trait SliceOperator

Source
pub trait SliceOperator<E: CubeType>: CubeType<ExpandType = Self::Expand> {
    type Expand: SliceOperatorExpand<E>;

    // Provided methods
    fn slice<Start: Index, End: Index>(
        &self,
        start: Start,
        end: End,
    ) -> Slice<E>  { ... }
    fn __expand_slice(
        scope: &mut Scope,
        expand: Self::Expand,
        start: ExpandElementTyped<u32>,
        end: ExpandElementTyped<u32>,
    ) -> ExpandElementTyped<Slice<E>> { ... }
    fn slice_mut<Start: Index, End: Index>(
        &mut self,
        start: Start,
        end: End,
    ) -> SliceMut<E> { ... }
    fn __expand_slice_mut(
        scope: &mut Scope,
        expand: Self::Expand,
        start: ExpandElementTyped<u32>,
        end: ExpandElementTyped<u32>,
    ) -> ExpandElementTyped<SliceMut<E>> { ... }
    fn to_slice(&self) -> Slice<E>  { ... }
    fn __expand_to_slice(
        scope: &mut Scope,
        expand: Self::Expand,
    ) -> ExpandElementTyped<Slice<E>> { ... }
    fn to_slice_mut(&mut self) -> SliceMut<E> { ... }
    fn __expand_to_slice_mut(
        scope: &mut Scope,
        expand: Self::Expand,
    ) -> ExpandElementTyped<SliceMut<E>> { ... }
}

Required Associated Types§

Provided Methods§

Source

fn slice<Start: Index, End: Index>(&self, start: Start, end: End) -> Slice<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 __expand_slice( scope: &mut Scope, expand: Self::Expand, start: ExpandElementTyped<u32>, end: ExpandElementTyped<u32>, ) -> ExpandElementTyped<Slice<E>>

Expand function of SliceOperator::slice.

Source

fn slice_mut<Start: Index, End: Index>( &mut self, start: Start, end: End, ) -> SliceMut<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_mut( scope: &mut Scope, expand: Self::Expand, start: ExpandElementTyped<u32>, end: ExpandElementTyped<u32>, ) -> ExpandElementTyped<SliceMut<E>>

Expand function of SliceOperator::slice_mut.

Source

fn to_slice(&self) -> Slice<E>

Reinterprete the current type as a read-only slice.

Source

fn __expand_to_slice( scope: &mut Scope, expand: Self::Expand, ) -> ExpandElementTyped<Slice<E>>

Expand function of SliceOperator::to_slice.

Source

fn to_slice_mut(&mut self) -> SliceMut<E>

Reinterprete the current type as a read-write slice.

Source

fn __expand_to_slice_mut( scope: &mut Scope, expand: Self::Expand, ) -> ExpandElementTyped<SliceMut<E>>

Expand function of SliceOperator::to_slice_mut.

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.

Implementors§