pub trait RecordProducer:
Send
+ Sync
+ 'static {
// Required methods
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
partition: Option<i32>,
key: Option<Bytes>,
value: Option<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn send_with_timestamp<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
partition: Option<i32>,
key: Option<Bytes>,
value: Option<Bytes>,
_timestamp_ms: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Required Methods§
Sourcefn send<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
partition: Option<i32>,
key: Option<Bytes>,
value: Option<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
partition: Option<i32>,
key: Option<Bytes>,
value: Option<Bytes>,
) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Enqueue a record to topic.
partition:
Noneuses the producer’s key-hash partitioner. This is correct for a sink topic or a repartition topic.Some(p)pins the record to partitionp. A changelog topic needs this, so that the task restore can read the record back from the task partition.
Provided Methods§
Sourcefn send_with_timestamp<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
partition: Option<i32>,
key: Option<Bytes>,
value: Option<Bytes>,
_timestamp_ms: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_with_timestamp<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
partition: Option<i32>,
key: Option<Bytes>,
value: Option<Bytes>,
_timestamp_ms: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<(), StreamsClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Like send, but it sets the record’s timestamp in epoch milliseconds
when timestamp_ms is Some.
The default delegates to send, and the producer then fills in the
wall-clock time. The broker producer overrides this method, so that a
versioned-store changelog record carries the version timestamp
(KIP-889).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".