Trait linera_views::batch::BatchValueWriter
source · pub trait BatchValueWriter<Batch>: Send + Sync {
// Required methods
fn is_empty(&self) -> bool;
fn write_next_value(
&mut self,
batch: &mut Batch,
batch_size: &mut usize,
) -> Result<bool, Error>;
fn next_batch_size(
&mut self,
batch: &Batch,
batch_size: usize,
) -> Result<Option<usize>, Error>;
}
Expand description
An iterator-like object that can write values one by one to a batch while updating the total size of the batch.
Required Methods§
sourcefn write_next_value(
&mut self,
batch: &mut Batch,
batch_size: &mut usize,
) -> Result<bool, Error>
fn write_next_value( &mut self, batch: &mut Batch, batch_size: &mut usize, ) -> Result<bool, Error>
Writes the next value (if any) to the batch and updates the batch size accordingly.
Returns false if there was no value to write.