pub struct SliceMut<E> { /* private fields */ }
Expand description
A read-write contiguous list of elements.
§Safety
Since data can be accessed by any unit during kernel execution, this can never be safe.
Implementations§
Source§impl<E> SliceMut<E>
impl<E> SliceMut<E>
Sourcepub fn into_aligned(self) -> SliceMut<Line<E>>where
E: CubePrimitive,
pub fn into_aligned(self) -> SliceMut<Line<E>>where
E: CubePrimitive,
Returns the same slice, but with lines of length 1.
Source§impl<E: CubePrimitive> SliceMut<E>
impl<E: CubePrimitive> SliceMut<E>
Sourcepub unsafe fn index_unchecked<I: Index>(&self, _i: I) -> &Ewhere
Self: CubeIndex<I>,
pub unsafe fn index_unchecked<I: Index>(&self, _i: I) -> &Ewhere
Self: CubeIndex<I>,
Perform an unchecked index into the array
§Safety
Out of bounds indexing causes undefined behaviour and may segfault. Ensure index is always in bounds
Sourcepub unsafe fn index_assign_unchecked<I: Index>(&mut self, _i: I, _value: E)where
Self: CubeIndexMut<I>,
pub unsafe fn index_assign_unchecked<I: Index>(&mut self, _i: I, _value: E)where
Self: CubeIndexMut<I>,
Perform an unchecked index assignment into the array
§Safety
Out of bounds indexing causes undefined behaviour and may segfault. Ensure index is always in bounds
Trait Implementations§
Source§impl<E: CubeType, I: Index> CubeIndexMut<I> for SliceMut<E>
impl<E: CubeType, I: Index> CubeIndexMut<I> for SliceMut<E>
fn cube_idx_mut(&mut self, _i: T) -> &mut Self::Output
Source§impl<E: CubeType> CubeType for &mut SliceMut<E>
impl<E: CubeType> CubeType for &mut SliceMut<E>
type ExpandType = ExpandElementTyped<SliceMut<E>>
Source§fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
Source§impl<E: CubeType> CubeType for SliceMut<E>
impl<E: CubeType> CubeType for SliceMut<E>
type ExpandType = ExpandElementTyped<SliceMut<E>>
Source§fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
Source§impl<E: CubePrimitive> IntoRuntime for SliceMut<E>
impl<E: CubePrimitive> IntoRuntime for SliceMut<E>
fn __expand_runtime_method(self, _context: &mut CubeContext) -> Self::ExpandType
Source§fn runtime(self) -> Self
fn runtime(self) -> Self
Make sure a type is actually expanded into its runtime expand type.
Source§impl<E: CubePrimitive> SliceOperator<E> for SliceMut<E>
impl<E: CubePrimitive> SliceOperator<E> for SliceMut<E>
type Expand = ExpandElementTyped<SliceMut<E>>
Source§fn slice<Start: Index, End: Index>(&self, start: Start, end: End) -> Slice<E> ⓘ
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(
context: &mut CubeContext,
expand: Self::Expand,
start: ExpandElementTyped<u32>,
end: ExpandElementTyped<u32>,
) -> ExpandElementTyped<Slice<E>>
fn __expand_slice( context: &mut CubeContext, 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>
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(
context: &mut CubeContext,
expand: Self::Expand,
start: ExpandElementTyped<u32>,
end: ExpandElementTyped<u32>,
) -> ExpandElementTyped<SliceMut<E>>
fn __expand_slice_mut( context: &mut CubeContext, expand: Self::Expand, start: ExpandElementTyped<u32>, end: ExpandElementTyped<u32>, ) -> ExpandElementTyped<SliceMut<E>>
Expand function of SliceOperator::slice_mut.
Source§fn __expand_to_slice(
context: &mut CubeContext,
expand: Self::Expand,
) -> ExpandElementTyped<Slice<E>>
fn __expand_to_slice( context: &mut CubeContext, expand: Self::Expand, ) -> ExpandElementTyped<Slice<E>>
Expand function of SliceOperator::to_slice.
Source§fn to_slice_mut(&mut self) -> SliceMut<E>
fn to_slice_mut(&mut self) -> SliceMut<E>
Reinterprete the current type as a read-write slice.
Source§fn __expand_to_slice_mut(
context: &mut CubeContext,
expand: Self::Expand,
) -> ExpandElementTyped<SliceMut<E>>
fn __expand_to_slice_mut( context: &mut CubeContext, expand: Self::Expand, ) -> ExpandElementTyped<SliceMut<E>>
Expand function of SliceOperator::to_slice_mut.
Auto Trait Implementations§
impl<E> Freeze for SliceMut<E>
impl<E> RefUnwindSafe for SliceMut<E>where
E: RefUnwindSafe,
impl<E> Send for SliceMut<E>where
E: Send,
impl<E> Sync for SliceMut<E>where
E: Sync,
impl<E> Unpin for SliceMut<E>where
E: Unpin,
impl<E> UnwindSafe for SliceMut<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more