Type Alias krnl::buffer::Slice

source ·
pub type Slice<'a, T> = BufferBase<SliceRepr<'a, T>>;
Expand description

Slice

See BufferBase.

Aliased Type§

struct Slice<'a, T> { /* private fields */ }

Implementations§

source§

impl<'a, T: Scalar> Slice<'a, T>

source

pub fn from_host_slice(host_slice: &'a [T]) -> Self

Create a slice from a &[T].

Trait Implementations§

source§

impl<'a, T: Scalar> From<&'a [T]> for Slice<'a, T>

source§

fn from(host_slice: &'a [T]) -> Self

Converts to this type from the input type.
source§

impl<'a, T: Scalar> TryFrom<ScalarBufferBase<ScalarSliceRepr<'a>>> for Slice<'a, T>

§

type Error = ScalarBufferBase<ScalarSliceRepr<'a>>

The type returned in the event of a conversion error.
source§

fn try_from(slice: ScalarSlice<'a>) -> Result<Self, Self::Error>

Performs the conversion.