Trait SegmentProcessor
pub trait SegmentProcessor: Send {
// Required methods
fn name(&self) -> &'static str;
fn process(
&mut self,
data: SegmentData,
) -> Pin<Box<dyn Future<Output = Result<SegmentData, ProcessError>> + Send + '_>>;
// Provided methods
fn initialize(
&mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>> { ... }
fn finalize_dump(
&mut self,
completion: &DumpCompletion,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + '_>> { ... }
}dial9 and pipeline only.Expand description
A single step in the segment processing pipeline.
Implementations handle one concern: compress, symbolize, upload, etc. The driver calls processors in sequence for each segment.
§Panic safety
The driver catches panics from process() and skips the
panicking segment. The same processor instance is reused for subsequent
segments, so implementations must remain in a valid state after a panic
(i.e., no partially-updated invariants that would cause incorrect behavior
on the next call).
Required Methods§
fn process(
&mut self,
data: SegmentData,
) -> Pin<Box<dyn Future<Output = Result<SegmentData, ProcessError>> + Send + '_>>
fn process( &mut self, data: SegmentData, ) -> Pin<Box<dyn Future<Output = Result<SegmentData, ProcessError>> + Send + '_>>
Process a segment, transforming or consuming its data. Returns the (possibly modified) data for the next processor, or an error to skip this segment.
Provided Methods§
fn finalize_dump(
&mut self,
completion: &DumpCompletion,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + '_>>
fn finalize_dump( &mut self, completion: &DumpCompletion, ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + '_>>
Called once per finished dump in triggered mode (see
crate::dump), in pipeline order, so stages can flush any
per-dump state they accumulated. Return the S3 key of a manifest
written for this dump, or None; the last Some across the
pipeline lands on DumpReceipt::manifest_key.
Default: no-op returning None. Never called in continuous mode.
The same panic-safety contract as process()
applies.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".