pub trait Processor<KIn: Send, VIn: Send, KOut: Send, VOut: Send>: Send + 'static {
// Required method
fn process<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut ProcessorContext<'life2, 'life3, KOut, VOut>,
record: Record<KIn, VIn>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
// Provided methods
fn init<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut ProcessorContext<'life2, 'life3, KOut, VOut>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
A stateless record processor. One instance is created per task via
ProcessorSupplier::get. Mirrors org.apache.kafka.streams.processor.api.Processor.
§Lifecycle
The runtime invokes init once before the first record and close once at
task shutdown. TopologyTestDriver invokes
init when it instantiates a topology for tests.
Required Methods§
fn process<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut ProcessorContext<'life2, 'life3, KOut, VOut>,
record: Record<KIn, VIn>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Provided Methods§
fn init<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut ProcessorContext<'life2, 'life3, KOut, VOut>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Trait Implementations§
Source§impl<KIn, VIn, KOut, VOut> Processor<KIn, VIn, KOut, VOut> for Box<dyn Processor<KIn, VIn, KOut, VOut>>
A boxed processor is itself a Processor, delegating to the inner value.
impl<KIn, VIn, KOut, VOut> Processor<KIn, VIn, KOut, VOut> for Box<dyn Processor<KIn, VIn, KOut, VOut>>
A boxed processor is itself a Processor, delegating to the inner value.
This is what lets a ProcessorSupplier closure return Box<dyn Processor<…>> when the concrete type is chosen at runtime: the boxed value
still satisfies the supplier blanket impl (which only requires the closure’s
return type to be some Processor). For the common case, return the
concrete processor directly (|| MyProc) and skip the box entirely.
fn init<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut ProcessorContext<'life2, 'life3, KOut, VOut>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn process<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut ProcessorContext<'life2, 'life3, KOut, VOut>,
record: Record<KIn, VIn>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<KIn, VIn, KOut, VOut> Processor<KIn, VIn, KOut, VOut> for Box<dyn Processor<KIn, VIn, KOut, VOut>>
A boxed processor is itself a Processor, delegating to the inner value.
impl<KIn, VIn, KOut, VOut> Processor<KIn, VIn, KOut, VOut> for Box<dyn Processor<KIn, VIn, KOut, VOut>>
A boxed processor is itself a Processor, delegating to the inner value.
This is what lets a ProcessorSupplier closure return Box<dyn Processor<…>> when the concrete type is chosen at runtime: the boxed value
still satisfies the supplier blanket impl (which only requires the closure’s
return type to be some Processor). For the common case, return the
concrete processor directly (|| MyProc) and skip the box entirely.