pub struct AsyncConsumerBuilder { /* private fields */ }Expand description
Builder for constructing an AsyncConsumer asynchronously.
Implementations§
Source§impl AsyncConsumerBuilder
impl AsyncConsumerBuilder
Sourcepub fn new(hosts: Vec<String>) -> Self
pub fn new(hosts: Vec<String>) -> Self
Creates a new async consumer builder from bootstrap hosts.
Sourcepub fn with_group(self, group: String) -> Self
pub fn with_group(self, group: String) -> Self
Sets the consumer group.
Sourcepub fn with_topic(self, topic: String) -> Self
pub fn with_topic(self, topic: String) -> Self
Adds a topic subscription.
Sourcepub fn with_topics(self, topics: Vec<String>) -> Self
pub fn with_topics(self, topics: Vec<String>) -> Self
Adds multiple topic subscriptions.
Sourcepub fn with_security(self, security: SecurityConfig) -> Self
pub fn with_security(self, security: SecurityConfig) -> Self
Sets optional TLS security configuration for broker connections.
Sourcepub fn with_channel_capacity(self, channel_capacity: usize) -> Self
pub fn with_channel_capacity(self, channel_capacity: usize) -> Self
Backward-compatible no-op kept for API compatibility.
Sourcepub fn with_native_async(self, native_async: bool) -> Self
pub fn with_native_async(self, native_async: bool) -> Self
Backward-compatible setting kept for API compatibility.
Sourcepub fn with_fallback_offset(self, fallback_offset: FetchOffset) -> Self
pub fn with_fallback_offset(self, fallback_offset: FetchOffset) -> Self
Sets fallback offset used when there is no committed group offset.
Sourcepub fn with_native_retry_attempts(self, attempts: usize) -> Self
pub fn with_native_retry_attempts(self, attempts: usize) -> Self
Sets retry attempts for native async poll/commit recoverable errors.
Sourcepub fn with_native_retry_backoff(self, backoff: Duration) -> Self
pub fn with_native_retry_backoff(self, backoff: Duration) -> Self
Sets retry backoff for native async poll/commit recoverable errors.
Sourcepub fn with_native_recent_error_limit(self, limit: usize) -> Self
pub fn with_native_recent_error_limit(self, limit: usize) -> Self
Sets the max number of native recent error snapshots retained in memory.
Sourcepub async fn build(self) -> Result<AsyncConsumer>
pub async fn build(self) -> Result<AsyncConsumer>
Builds an async consumer.
Auto Trait Implementations§
impl Freeze for AsyncConsumerBuilder
impl RefUnwindSafe for AsyncConsumerBuilder
impl Send for AsyncConsumerBuilder
impl Sync for AsyncConsumerBuilder
impl Unpin for AsyncConsumerBuilder
impl UnsafeUnpin for AsyncConsumerBuilder
impl UnwindSafe for AsyncConsumerBuilder
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