Trait cubecl::prelude::SliceOperator
source · pub trait SliceOperator<E>: CubeType<ExpandType = Self::Expand>where
E: CubeType,{
type Expand: SliceOperatorExpand<E>;
// Provided methods
fn slice<Start, End>(&self, start: Start, end: End) -> &Slice<'_, E>
where Start: Index,
End: Index { ... }
fn __expand_slice<Start, End>(
context: &mut CubeContext,
expand: Self::Expand,
start: Start,
end: End,
) -> ExpandElementTyped<Slice<'static, E>>
where Start: Index,
End: Index { ... }
fn slice_mut<Start, End>(
&mut self,
start: Start,
end: End,
) -> &mut SliceMut<'_, E>
where Start: Index,
End: Index { ... }
fn __expand_slice_mut<Start, End>(
context: &mut CubeContext,
expand: Self::Expand,
start: Start,
end: End,
) -> ExpandElementTyped<SliceMut<'static, E>>
where Start: Index,
End: Index { ... }
fn slice_mut_unsafe<Start, End>(
&self,
start: Start,
end: End,
) -> &mut SliceMut<'_, E>
where Start: Index,
End: Index { ... }
fn __expand_slice_mut_unsafe<Start, End>(
context: &mut CubeContext,
expand: Self::Expand,
start: Start,
end: End,
) -> ExpandElementTyped<SliceMut<'static, E>>
where Start: Index,
End: Index { ... }
fn as_slice(&self) -> &Slice<'_, E> { ... }
fn __expand_as_slice(
context: &mut CubeContext,
expand: Self::Expand,
) -> ExpandElementTyped<Slice<'static, E>> { ... }
fn as_slice_mut(&mut self) -> &mut SliceMut<'_, E> { ... }
fn __expand_as_slice_mut(
context: &mut CubeContext,
expand: Self::Expand,
) -> ExpandElementTyped<SliceMut<'static, E>> { ... }
fn as_slice_mut_unsafe(&self) -> &mut SliceMut<'_, E> { ... }
fn __expand_as_slice_mut_unsafe(
context: &mut CubeContext,
expand: Self::Expand,
) -> ExpandElementTyped<SliceMut<'static, E>> { ... }
}Required Associated Types§
type Expand: SliceOperatorExpand<E>
Provided Methods§
sourcefn slice<Start, End>(&self, start: Start, end: End) -> &Slice<'_, E>where
Start: Index,
End: Index,
fn slice<Start, End>(&self, start: Start, end: End) -> &Slice<'_, E>where
Start: Index,
End: Index,
Return a read-only view of all elements comprise between the start and end index.
sourcefn __expand_slice<Start, End>(
context: &mut CubeContext,
expand: Self::Expand,
start: Start,
end: End,
) -> ExpandElementTyped<Slice<'static, E>>where
Start: Index,
End: Index,
fn __expand_slice<Start, End>(
context: &mut CubeContext,
expand: Self::Expand,
start: Start,
end: End,
) -> ExpandElementTyped<Slice<'static, E>>where
Start: Index,
End: Index,
Expand function of SliceOperator::slice.
sourcefn slice_mut<Start, End>(
&mut self,
start: Start,
end: End,
) -> &mut SliceMut<'_, E>where
Start: Index,
End: Index,
fn slice_mut<Start, End>(
&mut self,
start: Start,
end: End,
) -> &mut SliceMut<'_, E>where
Start: Index,
End: Index,
Return a read-write view of all elements comprise between the start and end index.
sourcefn __expand_slice_mut<Start, End>(
context: &mut CubeContext,
expand: Self::Expand,
start: Start,
end: End,
) -> ExpandElementTyped<SliceMut<'static, E>>where
Start: Index,
End: Index,
fn __expand_slice_mut<Start, End>(
context: &mut CubeContext,
expand: Self::Expand,
start: Start,
end: End,
) -> ExpandElementTyped<SliceMut<'static, E>>where
Start: Index,
End: Index,
Expand function of SliceOperator::slice_mut.
sourcefn slice_mut_unsafe<Start, End>(
&self,
start: Start,
end: End,
) -> &mut SliceMut<'_, E>where
Start: Index,
End: Index,
fn slice_mut_unsafe<Start, End>(
&self,
start: Start,
end: End,
) -> &mut SliceMut<'_, E>where
Start: Index,
End: Index,
Return a read-write view of all elements comprise between the start and end index.
§Warning
Ignore the multiple borrow rule.
sourcefn __expand_slice_mut_unsafe<Start, End>(
context: &mut CubeContext,
expand: Self::Expand,
start: Start,
end: End,
) -> ExpandElementTyped<SliceMut<'static, E>>where
Start: Index,
End: Index,
fn __expand_slice_mut_unsafe<Start, End>(
context: &mut CubeContext,
expand: Self::Expand,
start: Start,
end: End,
) -> ExpandElementTyped<SliceMut<'static, E>>where
Start: Index,
End: Index,
Expand function of SliceOperator::slice_mut_unsafe.
sourcefn __expand_as_slice(
context: &mut CubeContext,
expand: Self::Expand,
) -> ExpandElementTyped<Slice<'static, E>>
fn __expand_as_slice( context: &mut CubeContext, expand: Self::Expand, ) -> ExpandElementTyped<Slice<'static, E>>
Expand function of SliceOperator::as_slice.
sourcefn as_slice_mut(&mut self) -> &mut SliceMut<'_, E>
fn as_slice_mut(&mut self) -> &mut SliceMut<'_, E>
Reinterprete the current type as a read-write slice.
sourcefn __expand_as_slice_mut(
context: &mut CubeContext,
expand: Self::Expand,
) -> ExpandElementTyped<SliceMut<'static, E>>
fn __expand_as_slice_mut( context: &mut CubeContext, expand: Self::Expand, ) -> ExpandElementTyped<SliceMut<'static, E>>
Expand function of SliceOperator::as_slice_mut.
sourcefn as_slice_mut_unsafe(&self) -> &mut SliceMut<'_, E>
fn as_slice_mut_unsafe(&self) -> &mut SliceMut<'_, E>
sourcefn __expand_as_slice_mut_unsafe(
context: &mut CubeContext,
expand: Self::Expand,
) -> ExpandElementTyped<SliceMut<'static, E>>
fn __expand_as_slice_mut_unsafe( context: &mut CubeContext, expand: Self::Expand, ) -> ExpandElementTyped<SliceMut<'static, E>>
Expand function of SliceOperator::as_slice_mut_unsafe.
Object Safety§
This trait is not object safe.