Trait AsConsumer

Source
pub trait AsConsumer: Sized {
    type Offset: IsOffset;
    type Meta: IsMeta;
    type Data: IntoIterator<Item = RawResult<RawBlock>>;

Show 15 methods // Required methods fn subscribe<T: Into<String>, I: IntoIterator<Item = T> + Send>( &mut self, topics: I, ) -> RawResult<()>; fn recv_timeout( &self, timeout: Timeout, ) -> RawResult<Option<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>>; fn commit(&self, offset: Self::Offset) -> RawResult<()>; fn commit_offset( &self, topic_name: &str, vgroup_id: VGroupId, offset: i64, ) -> RawResult<()>; fn list_topics(&self) -> RawResult<Vec<String>>; fn assignments(&self) -> Option<Vec<(String, Vec<Assignment>)>>; fn offset_seek( &mut self, topic: &str, vg_id: VGroupId, offset: i64, ) -> RawResult<()>; fn committed(&self, topic: &str, vgroup_id: VGroupId) -> RawResult<i64>; fn position(&self, topic: &str, vgroup_id: VGroupId) -> RawResult<i64>; // Provided methods fn default_timeout(&self) -> Timeout { ... } fn recv( &self, ) -> RawResult<Option<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>> { ... } fn iter_data_only( &self, timeout: Timeout, ) -> Box<dyn Iterator<Item = RawResult<(Self::Offset, Self::Data)>> + '_> { ... } fn iter_with_timeout(&self, timeout: Timeout) -> MessageSetsIter<'_, Self> { ... } fn iter(&self) -> MessageSetsIter<'_, Self> { ... } fn unsubscribe(self) { ... }
}

Required Associated Types§

Required Methods§

Source

fn subscribe<T: Into<String>, I: IntoIterator<Item = T> + Send>( &mut self, topics: I, ) -> RawResult<()>

Source

fn recv_timeout( &self, timeout: Timeout, ) -> RawResult<Option<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>>

None means wait until next message come.

Source

fn commit(&self, offset: Self::Offset) -> RawResult<()>

Source

fn commit_offset( &self, topic_name: &str, vgroup_id: VGroupId, offset: i64, ) -> RawResult<()>

Source

fn list_topics(&self) -> RawResult<Vec<String>>

Source

fn assignments(&self) -> Option<Vec<(String, Vec<Assignment>)>>

Source

fn offset_seek( &mut self, topic: &str, vg_id: VGroupId, offset: i64, ) -> RawResult<()>

Source

fn committed(&self, topic: &str, vgroup_id: VGroupId) -> RawResult<i64>

Source

fn position(&self, topic: &str, vgroup_id: VGroupId) -> RawResult<i64>

Provided Methods§

Source

fn default_timeout(&self) -> Timeout

Default timeout getter for message stream.

Source

fn recv( &self, ) -> RawResult<Option<(Self::Offset, MessageSet<Self::Meta, Self::Data>)>>

Source

fn iter_data_only( &self, timeout: Timeout, ) -> Box<dyn Iterator<Item = RawResult<(Self::Offset, Self::Data)>> + '_>

Source

fn iter_with_timeout(&self, timeout: Timeout) -> MessageSetsIter<'_, Self>

Source

fn iter(&self) -> MessageSetsIter<'_, Self>

Source

fn unsubscribe(self)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§