pub trait SinkFormatter {
type K;
type V;
// Required method
fn format_chunk(
&self,
chunk: &StreamChunk,
) -> impl Iterator<Item = Result<(Option<Self::K>, Option<Self::V>)>>;
}
Expand description
Transforms a StreamChunk
into a sequence of key-value pairs according a specific format,
for example append-only, upsert or debezium.
Required Associated Types§
Required Methods§
sourcefn format_chunk(
&self,
chunk: &StreamChunk,
) -> impl Iterator<Item = Result<(Option<Self::K>, Option<Self::V>)>>
fn format_chunk( &self, chunk: &StreamChunk, ) -> impl Iterator<Item = Result<(Option<Self::K>, Option<Self::V>)>>
- Key may be None so that messages are partitioned using round-robin.
For example append-only without
primary_key
(akadownstream_pk
) set. - Value may be None so that messages with same key are removed during log compaction. For example debezium tombstone event.
Object Safety§
This trait is not object safe.