Struct rdkafka::consumer::stream_consumer::StreamConsumer
[−]
[src]
#[must_use = "Consumer polling thread will stop immediately if unused"] pub struct StreamConsumer<C: ConsumerContext + 'static> { /* fields omitted */ }
A Consumer with an associated polling thread. This consumer doesn't need to
be polled and it will return all consumed messages as a Stream
.
Methods
impl<C: ConsumerContext> StreamConsumer<C>
[src]
fn start(&mut self) -> Receiver<Message, KafkaError>
Starts the StreamConsumer, returning a Stream.
fn stop(&mut self)
Stops the StreamConsumer. It blocks until the internal consumer has been stopped.
Trait Implementations
impl<C: ConsumerContext> Consumer<C> for StreamConsumer<C>
[src]
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.
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. Read more
impl FromClientConfig for StreamConsumer<EmptyConsumerContext>
[src]
fn from_config(config: &ClientConfig)
-> KafkaResult<StreamConsumer<EmptyConsumerContext>>
-> KafkaResult<StreamConsumer<EmptyConsumerContext>>
impl<C: ConsumerContext> FromClientConfigAndContext<C> for StreamConsumer<C>
[src]
Creates a new Consumer starting from a ClientConfig.
fn from_config_and_context(config: &ClientConfig,
context: C)
-> KafkaResult<StreamConsumer<C>>
context: C)
-> KafkaResult<StreamConsumer<C>>