pub trait NextBatchProvider {
// Required methods
fn next_batch<'life0, 'life1, 'async_trait>(
&'life0 mut self,
parent: L2BlockInfo,
l1_origins: &'life1 [BlockInfo],
) -> Pin<Box<dyn Future<Output = PipelineResult<Batch>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn span_buffer_size(&self) -> usize;
fn flush(&mut self);
}
Expand description
Provides Batches for the BatchQueue and BatchValidator stages.
Required Methods§
Sourcefn next_batch<'life0, 'life1, 'async_trait>(
&'life0 mut self,
parent: L2BlockInfo,
l1_origins: &'life1 [BlockInfo],
) -> Pin<Box<dyn Future<Output = PipelineResult<Batch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn next_batch<'life0, 'life1, 'async_trait>(
&'life0 mut self,
parent: L2BlockInfo,
l1_origins: &'life1 [BlockInfo],
) -> Pin<Box<dyn Future<Output = PipelineResult<Batch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns the next Batch in the ChannelReader stage, if the stage is not complete.
This function can only be called once while the stage is in progress, and will return
None
on subsequent calls unless the stage is reset or complete. If the stage is
complete and the batch has been consumed, an PipelineError::Eof error is returned.
Sourcefn span_buffer_size(&self) -> usize
fn span_buffer_size(&self) -> usize
Returns the number of SingleBatches that are currently buffered in the BatchStream from a SpanBatch.
Sourcefn flush(&mut self)
fn flush(&mut self)
Allows the stage to flush the buffer in the crate::stages::BatchStream if an invalid single batch is found. Pre-holocene hardfork, this will be a no-op.