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

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

A ProducerContext is an object that can be used during the creation of a producer to customizer its behavior. In particular, it can be used to specify the delivery callback that will be called when the ack from a delivered message is received.

Associated Types

type DeliveryOpaque: IntoOpaque

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
)

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]

Loading content...