Trait rdkafka::producer::ProducerContext[][src]

pub trait ProducerContext: ClientContext {
    type DeliveryOpaque: IntoOpaque;
    fn delivery(
        &self,
        delivery_result: &DeliveryResult<'_>,
        delivery_opaque: Self::DeliveryOpaque
    ); }

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.

Loading content...

Required methods

fn delivery(
    &self,
    delivery_result: &DeliveryResult<'_>,
    delivery_opaque: Self::DeliveryOpaque
)
[src]

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.

Loading content...

Implementors

impl ProducerContext for DefaultProducerContext[src]

type DeliveryOpaque = ()

impl<C: ClientContext + 'static> ProducerContext for FutureProducerContext<C>[src]

type DeliveryOpaque = Box<Sender<OwnedDeliveryResult>>

Loading content...