pub struct TaggedRowBuffer { /* private fields */ }Expand description
A TaggedRowBuffer wraps a RowBuffer but also keeps track of a source
RowId for the row it contains. This makes it useful for materializing
the contents of a Subset of a table.
Implementations§
Source§impl TaggedRowBuffer
impl TaggedRowBuffer
Sourcepub fn new(n_columns: usize) -> TaggedRowBuffer
pub fn new(n_columns: usize) -> TaggedRowBuffer
Create a new buffer with the given arity.
Sourcepub fn add_row(&mut self, row_id: RowId, row: &[Value]) -> RowId
pub fn add_row(&mut self, row_id: RowId, row: &[Value]) -> RowId
Add the given row and RowId to the buffer, returning the RowId (in
self) for the new row.
Sourcepub fn get_row(&self, row: RowId) -> (RowId, &[Value])
pub fn get_row(&self, row: RowId) -> (RowId, &[Value])
Get the row (and the id it was associated with at insertion time) at the
offset associated with row.
pub fn get_row_mut(&mut self, row: RowId) -> (RowId, &mut [Value])
Sourcepub fn iter(&self) -> impl Iterator<Item = (RowId, &[Value])>
pub fn iter(&self) -> impl Iterator<Item = (RowId, &[Value])>
Iterate over the contents of the buffer.
Sourcepub fn par_iter(&self) -> impl ParallelIterator<Item = (RowId, &[Value])>
pub fn par_iter(&self) -> impl ParallelIterator<Item = (RowId, &[Value])>
Iterate over the contents of the buffer in parallel.
Sourcepub fn non_stale(&self) -> impl Iterator<Item = (RowId, &[Value])>
pub fn non_stale(&self) -> impl Iterator<Item = (RowId, &[Value])>
Iterate over all rows in the buffer, except for the stale ones.
Sourcepub fn non_stale_mut(&mut self) -> impl Iterator<Item = (RowId, &mut [Value])>
pub fn non_stale_mut(&mut self) -> impl Iterator<Item = (RowId, &mut [Value])>
Iterate over all rows in the buffer, except for the stale ones.
pub fn set_stale(&mut self, row: RowId) -> bool
Auto Trait Implementations§
impl Freeze for TaggedRowBuffer
impl !RefUnwindSafe for TaggedRowBuffer
impl Send for TaggedRowBuffer
impl Sync for TaggedRowBuffer
impl Unpin for TaggedRowBuffer
impl UnwindSafe for TaggedRowBuffer
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
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