[][src]Struct rdkafka::consumer::stream_consumer::StreamConsumer

#[must_use = "Consumer polling thread will stop immediately if unused"]
pub struct StreamConsumer<C: ConsumerContext + 'static = DefaultConsumerContext> { /* fields omitted */ }

A Kafka Consumer providing a futures::Stream interface.

This consumer doesn't need to be polled since it has a separate polling thread. Due to the asynchronous nature of the stream, some messages might be consumed by the consumer without being processed on the other end of the stream. If auto commit is used, it might cause message loss after consumer restart. Manual offset storing should be used, see the store_offset function on Consumer.

Methods

impl<C: ConsumerContext> StreamConsumer<C>[src]

pub fn start(&self) -> MessageStream<C>[src]

Starts the StreamConsumer with default configuration (100ms polling interval and no NoMessageReceived notifications).

pub fn start_with(
    &self,
    poll_interval: Duration,
    no_message_error: bool
) -> MessageStream<C>
[src]

Starts the StreamConsumer with the specified poll interval. Additionally, if no_message_error is set to true, it will return an error of type KafkaError::NoMessageReceived every time the poll interval is reached and no message has been received.

pub fn stop(&self)[src]

Stops the StreamConsumer, blocking the caller until the internal consumer has been stopped.

Trait Implementations

impl<C: ConsumerContext> Consumer<C> for StreamConsumer<C>[src]

impl<C: ConsumerContext> Drop for StreamConsumer<C>[src]

impl FromClientConfig for StreamConsumer[src]

impl<C: ConsumerContext> FromClientConfigAndContext<C> for StreamConsumer<C>[src]

Creates a new StreamConsumer starting from a ClientConfig.

Auto Trait Implementations

impl<C> RefUnwindSafe for StreamConsumer<C> where
    C: RefUnwindSafe

impl<C> Send for StreamConsumer<C>

impl<C> Sync for StreamConsumer<C>

impl<C> Unpin for StreamConsumer<C>

impl<C> UnwindSafe for StreamConsumer<C> where
    C: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.