Trait rdkafka::producer::ProducerContext [−][src]
Producer-specific context.
This user-defined object can be used to provide custom callbacks for producer events. Refer to the list of methods to check which callbacks can be specified.
In particular, it can be used to specify the delivery
callback that will
be called when the acknowledgement for a delivered message is received.
See also the ClientContext
trait.
Associated Types
type DeliveryOpaque: IntoOpaque
[src]
A DeliveryOpaque
is a user-defined structure that will be passed to
the producer when producing a message, and returned to the delivery
method once the message has been delivered, or failed to.
Required methods
fn delivery(
&self,
delivery_result: &DeliveryResult<'_>,
delivery_opaque: Self::DeliveryOpaque
)
[src]
&self,
delivery_result: &DeliveryResult<'_>,
delivery_opaque: Self::DeliveryOpaque
)
This method will be called once the message has been delivered (or
failed to). The DeliveryOpaque
will be the one provided by the user
when calling send.
Implementors
impl ProducerContext for DefaultProducerContext
[src]
type DeliveryOpaque = ()
fn delivery(&self, _: &DeliveryResult<'_>, _: Self::DeliveryOpaque)
[src]
impl<C: ClientContext + 'static> ProducerContext for FutureProducerContext<C>
[src]
type DeliveryOpaque = Box<Sender<OwnedDeliveryResult>>
fn delivery(
&self,
delivery_result: &DeliveryResult<'_>,
tx: Box<Sender<OwnedDeliveryResult>>
)
[src]
&self,
delivery_result: &DeliveryResult<'_>,
tx: Box<Sender<OwnedDeliveryResult>>
)