pub struct AsyncConsumer { /* private fields */ }Expand description
An async Kafka consumer.
Implementations§
Source§impl AsyncConsumer
impl AsyncConsumer
Sourcepub fn builder(hosts: Vec<String>) -> AsyncConsumerBuilder
pub fn builder(hosts: Vec<String>) -> AsyncConsumerBuilder
Starts building a new async consumer from bootstrap hosts.
Sourcepub async fn from_hosts(
hosts: Vec<String>,
group: String,
topics: Vec<String>,
) -> Result<Self>
pub async fn from_hosts( hosts: Vec<String>, group: String, topics: Vec<String>, ) -> Result<Self>
Creates a new async consumer from bootstrap hosts.
Sourcepub async fn from_client(
client: AsyncKafkaClient,
group: String,
topics: Vec<String>,
) -> Result<Self>
pub async fn from_client( client: AsyncKafkaClient, group: String, topics: Vec<String>, ) -> Result<Self>
Creates a new async consumer from an AsyncKafkaClient.
Sourcepub async fn poll(&mut self) -> Result<MessageSets>
pub async fn poll(&mut self) -> Result<MessageSets>
Polls for new messages and returns fetched message sets.
Sourcepub fn native_error_stats(&self) -> Option<NativeConsumerErrorStats>
pub fn native_error_stats(&self) -> Option<NativeConsumerErrorStats>
Returns native consumer error statistics when running in native mode.
Sourcepub fn reset_native_error_stats(&mut self) -> bool
pub fn reset_native_error_stats(&mut self) -> bool
Resets native consumer error statistics.
Returns true when reset was performed (native mode), otherwise false.
Auto Trait Implementations§
impl Freeze for AsyncConsumer
impl !RefUnwindSafe for AsyncConsumer
impl Send for AsyncConsumer
impl Sync for AsyncConsumer
impl Unpin for AsyncConsumer
impl UnsafeUnpin for AsyncConsumer
impl !UnwindSafe for AsyncConsumer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more