Struct rdkafka::producer::BaseProducer
[−]
[src]
pub struct BaseProducer<C: ProducerContext> { /* fields omitted */ }
Contains a reference counted producer client. It can be safely cloned to create another reference to the same producer.
Methods
impl<C: ProducerContext> BaseProducer<C>
[src]
fn get_topic<'b>(&'b self,
name: &str,
config: &TopicConfig)
-> KafkaResult<Topic<'b, C>>
name: &str,
config: &TopicConfig)
-> KafkaResult<Topic<'b, C>>
Returns a topic associated to the producer
fn poll(&self, timeout_ms: i32) -> i32
Polls the producer. Regular calls to poll
are required to process the evens
and execute the message delivery callbacks.
fn send_copy<P, K>(&self,
topic: &Topic<C>,
partition: Option<i32>,
payload: Option<&P>,
key: Option<&K>,
delivery_context: Option<Box<C::DeliveryContext>>)
-> KafkaResult<()> where K: ToBytes, P: ToBytes
topic: &Topic<C>,
partition: Option<i32>,
payload: Option<&P>,
key: Option<&K>,
delivery_context: Option<Box<C::DeliveryContext>>)
-> KafkaResult<()> where K: ToBytes, P: ToBytes
Trait Implementations
impl FromClientConfig for BaseProducer<EmptyProducerContext>
[src]
fn from_config(config: &ClientConfig)
-> KafkaResult<BaseProducer<EmptyProducerContext>>
-> KafkaResult<BaseProducer<EmptyProducerContext>>
impl<C: ProducerContext> FromClientConfigAndContext<C> for BaseProducer<C>
[src]
Creates a new BaseProducer
starting from a ClientConfig.
fn from_config_and_context(config: &ClientConfig,
context: C)
-> KafkaResult<BaseProducer<C>>
context: C)
-> KafkaResult<BaseProducer<C>>