Trait rdkafka::consumer::Consumer
[−]
[src]
pub trait Consumer<C: ConsumerContext> { fn get_base_consumer(&self) -> &BaseConsumer<C>; fn get_base_consumer_mut(&mut self) -> &mut BaseConsumer<C>; fn subscribe(&mut self, topics: &Vec<&str>) -> KafkaResult<()> { ... } fn assign(&mut self, assignment: &TopicPartitionList) -> KafkaResult<()> { ... } fn commit_message(&self, message: &Message, mode: CommitMode) { ... } }
Common trait for all consumers
Required Methods
fn get_base_consumer(&self) -> &BaseConsumer<C>
Returns a reference to the BaseConsumer.
fn get_base_consumer_mut(&mut self) -> &mut BaseConsumer<C>
Returns a mutable reference to the BaseConsumer.
Provided Methods
fn subscribe(&mut self, topics: &Vec<&str>) -> KafkaResult<()>
Subscribe the consumer to a list of topics.
fn assign(&mut self, assignment: &TopicPartitionList) -> KafkaResult<()>
Manually assign topics and partitions to the consumer.
fn commit_message(&self, message: &Message, mode: CommitMode)
Commit a specific message. If mode is set to CommitMode::Sync, the call will block until the message has been succesfully committed.
Implementors
impl<C: ConsumerContext> Consumer<C> for BaseConsumer<C>
impl<C: ConsumerContext> Consumer<C> for StreamConsumer<C>