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

pub trait ProducerContext: Context {
    type DeliveryContext: Send + Sync;
    fn delivery(&self, DeliveryStatus, Self::DeliveryContext);
}

A ProducerContext is a Context specific for producers. It can be used to store user-specified callbacks, such as delivery.

Associated Types

A DeliveryContext is a user-defined structure that will be passed to the base producer when producing a message. The base producer will call the received method on this data once the associated message has been processed correctly.

Required Methods

This method will be called once the message has beed delivered (or failed to). The DeliveryContext will be the one provided by the user when calling send.

Implementors