pub struct RowsBatchRef<'a, T> { /* private fields */ }
Expand description
This struct is similar to RowsBatch
, but it holds a reference to the slice of rows.
Unfortunately due to liftime issues we can’t have a single generic struct which is
parameterized by a container type.
Implementations§
Source§impl<'a, T> RowsBatchRef<'a, T>
impl<'a, T> RowsBatchRef<'a, T>
Sourcepub fn new(rows: &'a [&'a [T]], row_len: usize) -> Self
pub fn new(rows: &'a [&'a [T]], row_len: usize) -> Self
Create a new RowsBatchRef
from a slice of rows and the given row length.
§Panics
In case if any of the rows has a length different from n_cols
.
pub fn iter(&self) -> impl Iterator<Item = &'a [T]> + '_
pub fn rows(&self) -> &[&'a [T]]
pub fn n_rows(&self) -> usize
pub fn row_len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn map(&self, indices: impl AsRef<[usize]>) -> RowsBatch<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for RowsBatchRef<'a, T>
impl<'a, T> RefUnwindSafe for RowsBatchRef<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for RowsBatchRef<'a, T>where
T: Sync,
impl<'a, T> Sync for RowsBatchRef<'a, T>where
T: Sync,
impl<'a, T> Unpin for RowsBatchRef<'a, T>
impl<'a, T> UnwindSafe for RowsBatchRef<'a, T>where
T: RefUnwindSafe,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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