pub struct ArrayView<'a> { /* private fields */ }Expand description
Sources lent for one operation. The plan carries positions, never data or a materialization cache.
Implementations§
Source§impl<'a> ArrayView<'a>
impl<'a> ArrayView<'a>
pub fn new( layout: &'a Layout, sources: Vec<Binding<'a>>, plan: ReadPlan, ) -> Result<Self, Error>
pub fn compact(layout: &'a Layout, storage: View<'a>) -> Self
pub fn layout(&self) -> &'a Layout
pub fn dtype(&self) -> DType
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn read(&self) -> Read<'_>
pub fn plan(&self) -> &ReadPlan
pub fn sources(&self) -> &[Binding<'a>]
Sourcepub fn with_layout<'b>(
&self,
layout: &'b Layout,
) -> Result<ArrayView<'b>, Error>where
'a: 'b,
pub fn with_layout<'b>(
&self,
layout: &'b Layout,
) -> Result<ArrayView<'b>, Error>where
'a: 'b,
Changes metadata, retaining the logical sequence.
Sourcepub fn remapped(&self, mapping: Mapping, items: usize) -> Self
pub fn remapped(&self, mapping: Mapping, items: usize) -> Self
Composes a call’s positional read. Missing positions read the prototype (Missing::prototype).
pub fn contiguous(&self) -> Option<View<'a>>
pub fn affine(&self) -> Option<(View<'a>, usize, Vec<isize>)>
Sourcepub fn cast(&self, dtype: DType) -> Result<Items<'a>, Error>
pub fn cast(&self, dtype: DType) -> Result<Items<'a>, Error>
Borrows a contiguous read at its dtype, otherwise prepares exactly these logical items.
pub fn items<T: Element>(&self) -> Result<Cow<'a, [T]>, Error>
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ArrayView<'a>
impl<'a> !UnwindSafe for ArrayView<'a>
impl<'a> Forget for ArrayView<'a>
impl<'a> Freeze for ArrayView<'a>
impl<'a> Send for ArrayView<'a>
impl<'a> Sync for ArrayView<'a>
impl<'a> Unpin for ArrayView<'a>
impl<'a> UnsafeUnpin for ArrayView<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more