pub struct ChannelReader<P>{ /* private fields */ }
Expand description
ChannelReader is a stateful stage that reads Batches from Channel
s.
The ChannelReader pulls Channel
s from the channel bank as raw data
and pipes it into a BatchReader
. Since the raw data is compressed,
the BatchReader
first decompresses the data using the first bytes as
a compression algorithm identifier.
Once the data is decompressed, it is decoded into a Batch
and passed
to the next stage in the pipeline.
Implementations§
Source§impl<P> ChannelReader<P>
impl<P> ChannelReader<P>
Sourcepub const fn new(prev: P, cfg: Arc<RollupConfig>) -> ChannelReader<P>
pub const fn new(prev: P, cfg: Arc<RollupConfig>) -> ChannelReader<P>
Create a new ChannelReader stage.
Sourcepub fn next_channel(&mut self)
pub fn next_channel(&mut self)
Forces the read to continue with the next channel, resetting any decoding / decompression state to a fresh start.
Trait Implementations§
Source§impl<P> BatchStreamProvider for ChannelReader<P>
impl<P> BatchStreamProvider for ChannelReader<P>
Source§fn flush(&mut self)
fn flush(&mut self)
This method is called by the BatchStream if an invalid span batch is found. In the case of an invalid span batch, the associated channel must be flushed.
See: https://specs.optimism.io/protocol/holocene/derivation.html#span-batches
SAFETY: Only called post-holocene activation.
Source§fn next_batch<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Batch, PipelineErrorKind>> + Send + 'async_trait>>where
'life0: 'async_trait,
ChannelReader<P>: 'async_trait,
fn next_batch<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Batch, PipelineErrorKind>> + Send + 'async_trait>>where
'life0: 'async_trait,
ChannelReader<P>: 'async_trait,
Source§impl<P> Debug for ChannelReader<P>
impl<P> Debug for ChannelReader<P>
Source§impl<P> OriginAdvancer for ChannelReader<P>
impl<P> OriginAdvancer for ChannelReader<P>
Source§fn advance_origin<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), PipelineErrorKind>> + Send + 'async_trait>>where
'life0: 'async_trait,
ChannelReader<P>: 'async_trait,
fn advance_origin<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), PipelineErrorKind>> + Send + 'async_trait>>where
'life0: 'async_trait,
ChannelReader<P>: 'async_trait,
advance_l1_block
.Source§impl<P> OriginProvider for ChannelReader<P>
impl<P> OriginProvider for ChannelReader<P>
Source§impl<P> SignalReceiver for ChannelReader<P>
impl<P> SignalReceiver for ChannelReader<P>
Auto Trait Implementations§
impl<P> Freeze for ChannelReader<P>where
P: Freeze,
impl<P> RefUnwindSafe for ChannelReader<P>where
P: RefUnwindSafe,
impl<P> Send for ChannelReader<P>where
P: Send,
impl<P> Sync for ChannelReader<P>where
P: Sync,
impl<P> Unpin for ChannelReader<P>where
P: Unpin,
impl<P> UnwindSafe for ChannelReader<P>where
P: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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