pub trait SliceExt<E: CubePrimitive> {
Show 18 methods
// Required methods
fn __expand_as_vectorized<'infer>(
scope: &Scope,
this: &'infer SliceExpand<E>,
) -> &'infer SliceExpand<Vector<E::Scalar, E::Size>>;
fn __expand_as_vectorized_mut<'infer>(
scope: &Scope,
this: &'infer mut SliceExpand<E>,
) -> &'infer mut SliceExpand<Vector<E::Scalar, E::Size>>;
fn __expand_downcast<'infer, T: CubePrimitive>(
scope: &Scope,
this: &'infer SliceExpand<E>,
) -> &'infer SliceExpand<T>;
fn __expand_downcast_mut<'infer, T: CubePrimitive>(
scope: &Scope,
this: &'infer mut SliceExpand<E>,
) -> &'infer mut SliceExpand<T>;
fn __expand_downcast_unchecked<'infer, T: CubePrimitive>(
scope: &Scope,
this: &'infer SliceExpand<E>,
) -> &'infer SliceExpand<T>;
fn __expand_downcast_mut_unchecked<'infer, T: CubePrimitive>(
scope: &Scope,
this: &'infer mut SliceExpand<E>,
) -> &'infer mut SliceExpand<T>;
fn __expand_as_ptr(
scope: &Scope,
this: &SliceExpand<E>,
) -> *const NativeExpand<E>;
fn __expand_as_mut_ptr(
scope: &Scope,
this: &mut SliceExpand<E>,
) -> *mut NativeExpand<E>;
// Provided methods
fn as_vectorized(&self) -> &[Vector<E::Scalar, E::Size>] { ... }
fn as_vectorized_mut(&mut self) -> &mut [Vector<E::Scalar, E::Size>] { ... }
fn downcast<T: CubePrimitive>(&self) -> &[T] { ... }
fn downcast_mut<T: CubePrimitive>(&mut self) -> &mut [T] { ... }
unsafe fn downcast_unchecked<T: CubePrimitive>(&self) -> &[T] { ... }
unsafe fn downcast_mut_unchecked<T: CubePrimitive>(&mut self) -> &mut [T] { ... }
unsafe fn as_mut_unchecked(&self) -> &mut [E] { ... }
unsafe fn as_ptr_unchecked(&self) -> *const E { ... }
unsafe fn as_mut_ptr_unchecked(&mut self) -> *mut E { ... }
unsafe fn as_boxed_unchecked(&self) -> Box<[E]> { ... }
}Required Methods§
fn __expand_as_vectorized<'infer>( scope: &Scope, this: &'infer SliceExpand<E>, ) -> &'infer SliceExpand<Vector<E::Scalar, E::Size>>
fn __expand_as_vectorized_mut<'infer>( scope: &Scope, this: &'infer mut SliceExpand<E>, ) -> &'infer mut SliceExpand<Vector<E::Scalar, E::Size>>
fn __expand_downcast<'infer, T: CubePrimitive>( scope: &Scope, this: &'infer SliceExpand<E>, ) -> &'infer SliceExpand<T>
fn __expand_downcast_mut<'infer, T: CubePrimitive>( scope: &Scope, this: &'infer mut SliceExpand<E>, ) -> &'infer mut SliceExpand<T>
fn __expand_downcast_unchecked<'infer, T: CubePrimitive>( scope: &Scope, this: &'infer SliceExpand<E>, ) -> &'infer SliceExpand<T>
fn __expand_downcast_mut_unchecked<'infer, T: CubePrimitive>( scope: &Scope, this: &'infer mut SliceExpand<E>, ) -> &'infer mut SliceExpand<T>
fn __expand_as_ptr( scope: &Scope, this: &SliceExpand<E>, ) -> *const NativeExpand<E>
fn __expand_as_mut_ptr( scope: &Scope, this: &mut SliceExpand<E>, ) -> *mut NativeExpand<E>
Provided Methods§
Sourcefn as_vectorized(&self) -> &[Vector<E::Scalar, E::Size>]
fn as_vectorized(&self) -> &[Vector<E::Scalar, E::Size>]
Returns the same slice, but with the type reinterpreted as Vector.
Preserves existing vector size of the primitive.
Sourcefn as_vectorized_mut(&mut self) -> &mut [Vector<E::Scalar, E::Size>]
fn as_vectorized_mut(&mut self) -> &mut [Vector<E::Scalar, E::Size>]
Returns the same slice, but with the type reinterpreted as Vector.
Preserves existing vector size of the primitive.
Sourcefn downcast<T: CubePrimitive>(&self) -> &[T]
fn downcast<T: CubePrimitive>(&self) -> &[T]
Downcast the slice to the given type and panic if the type isn’t the same.
This function should only be used to satisfy the Rust type system, when two generic types are supposed to be the same.
Sourcefn downcast_mut<T: CubePrimitive>(&mut self) -> &mut [T]
fn downcast_mut<T: CubePrimitive>(&mut self) -> &mut [T]
Downcast the slice to the given type and panic if the type isn’t the same.
This function should only be used to satisfy the Rust type system, when two generic types are supposed to be the same.
Sourceunsafe fn downcast_unchecked<T: CubePrimitive>(&self) -> &[T]
unsafe fn downcast_unchecked<T: CubePrimitive>(&self) -> &[T]
Unsafely downcast the slice to the given type and panic if the type isn’t the same.
§Safety
This function converts unsafely, and should only be used for temporary storage with a dummy
type (i.e. ReinterpretSlice)
Sourceunsafe fn downcast_mut_unchecked<T: CubePrimitive>(&mut self) -> &mut [T]
unsafe fn downcast_mut_unchecked<T: CubePrimitive>(&mut self) -> &mut [T]
Unsafely downcast the slice to the given type and panic if the type isn’t the same.
§Safety
This function converts unsafely, and should only be used for temporary storage with a dummy
type (i.e. ReinterpretSlice)
Sourceunsafe fn as_mut_unchecked(&self) -> &mut [E]
unsafe fn as_mut_unchecked(&self) -> &mut [E]
Unsafely cast an immutable slice to a mutable one.
§Safety
This is safe in practice, but breaks semantics. Should only be used if absolutely necessary. May cause problems if an immutable input is reinterpreted as mutable.
Sourceunsafe fn as_ptr_unchecked(&self) -> *const E
unsafe fn as_ptr_unchecked(&self) -> *const E
Sourceunsafe fn as_mut_ptr_unchecked(&mut self) -> *mut E
unsafe fn as_mut_ptr_unchecked(&mut self) -> *mut E
Convert the slice to a mutable start pointer, without any bounds checks.
§Safety
Sourceunsafe fn as_boxed_unchecked(&self) -> Box<[E]>
unsafe fn as_boxed_unchecked(&self) -> Box<[E]>
Convert to an owned boxed slice. This is very unsafe as it completely erases the lifetime. Only use it for global kernel inputs, which have a static lifetime.
§Safety
Erases the lifetime. Only use when an owned representation is absolutely needed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".