pub struct Read<'a> {
pub sources: &'a [Binding<'a>],
pub plan: &'a ReadPlan,
}Expand description
Sources are bound at execution; plans never retain their data.
Fields§
§sources: &'a [Binding<'a>]§plan: &'a ReadPlanImplementations§
Source§impl<'s> Read<'s>
impl<'s> Read<'s>
pub fn positional(&self, shape: &[usize]) -> Option<(View<'_>, Mapping)>
Sourcepub fn part_view<'a>(
&'a self,
range: Range<usize>,
dtype: DType,
checked: bool,
scratch: &'a mut Buffer,
) -> Result<View<'a>, Error>
pub fn part_view<'a>( &'a self, range: Range<usize>, dtype: DType, checked: bool, scratch: &'a mut Buffer, ) -> Result<View<'a>, Error>
Borrows a contiguous input range; other reads use scratch at exactly the requested length.
Sourcepub fn argument<'a>(
self,
range: Range<usize>,
checked: bool,
scratch: &'a mut Buffer,
) -> Result<(View<'a>, usize), Error>where
's: 'a,
pub fn argument<'a>(
self,
range: Range<usize>,
checked: bool,
scratch: &'a mut Buffer,
) -> Result<(View<'a>, usize), Error>where
's: 'a,
A span at its actual storage dtype and the item count copied. Copied spans require sources of one dtype.
Sourcepub fn borrowed<T>(
&self,
range: Range<usize>,
checked: bool,
) -> Result<Option<Arg<'s, T>>, Error>where
T: Cast,
pub fn borrowed<T>(
&self,
range: Range<usize>,
checked: bool,
) -> Result<Option<Arg<'s, T>>, Error>where
T: Cast,
A typed span borrowed from storage, or one scalar converted once; None means array materialization is needed.
pub fn part<'a, T>(
&'a self,
range: Range<usize>,
checked: bool,
scratch: &'a mut Vec<T>,
) -> Result<Arg<'a, T>, Error>where
T: Cast,
Sourcepub fn part_counted<'a, T>(
&'a self,
range: Range<usize>,
checked: bool,
scratch: &'a mut Vec<T>,
) -> Result<(Arg<'a, T>, usize), Error>where
T: Cast,
pub fn part_counted<'a, T>(
&'a self,
range: Range<usize>,
checked: bool,
scratch: &'a mut Vec<T>,
) -> Result<(Arg<'a, T>, usize), Error>where
T: Cast,
The same read and the number of items it materialized in scratch; borrowed runs and scalar conversions count zero.
Sourcepub fn in_place<T>(&self, range: &Range<usize>) -> boolwhere
T: Cast,
pub fn in_place<T>(&self, range: &Range<usize>) -> boolwhere
T: Cast,
Whether part reads range in place, writing no scratch: one run of a source that holds T, or one item that every position reads.
Sourcepub fn rows<T>(&self, shape: [usize; 2]) -> Option<Rows<'s, T>>where
T: Cast,
pub fn rows<T>(&self, shape: [usize; 2]) -> Option<Rows<'s, T>>where
T: Cast,
This read as rows over a result of shape, which is rows then items, where every source is bound as the plan reads it, the plan maps one source that holds T affinely over shape, and each row reads one item or a run of items. None for any other read.
Sourcepub fn mapped_source(&self) -> Option<(View<'s>, &'s Mapping)>
pub fn mapped_source(&self) -> Option<(View<'s>, &'s Mapping)>
The whole source and the mapping of a read that maps one source with no fills, for a reader that walks the mapping itself (linalg::Mapped).
pub fn read_into( &self, range: Range<usize>, dtype: DType, checked: bool, output: &mut Buffer, ) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Read<'a>
impl<'a> !UnwindSafe for Read<'a>
impl<'a> Forget for Read<'a>
impl<'a> Freeze for Read<'a>
impl<'a> Send for Read<'a>
impl<'a> Sync for Read<'a>
impl<'a> Unpin for Read<'a>
impl<'a> UnsafeUnpin for Read<'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
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> ⓘ
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> ⓘ
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