pub struct CloseOptions { /* private fields */ }Expand description
Options for controlling the consumer close behavior.
This class allows customization of the close timeout and group membership operation when a consumer is being shut down.
Implementations§
Source§impl CloseOptions
impl CloseOptions
Sourcepub fn new_with_timeout(timeout: Duration) -> Self
pub fn new_with_timeout(timeout: Duration) -> Self
Static method to create a CloseOptions with a custom timeout.
§Arguments
timeout- The maximum time to wait for the consumer to close.
§Returns
A new CloseOptions instance with the specified timeout.
§Translation notes
timeout cannot be None: for the default timeout use
CloseOptions::default.
Sourcepub fn with_operation(operation: GroupMembershipOperation) -> Self
pub fn with_operation(operation: GroupMembershipOperation) -> Self
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sourcepub fn with_group_membership_operation(
self,
operation: GroupMembershipOperation,
) -> Self
pub fn with_group_membership_operation( self, operation: GroupMembershipOperation, ) -> Self
Sourcepub fn group_membership_operation(&self) -> GroupMembershipOperation
pub fn group_membership_operation(&self) -> GroupMembershipOperation
Returns the group membership operation configured for this close.
§Returns
The group membership operation
Trait Implementations§
Source§impl Clone for CloseOptions
impl Clone for CloseOptions
Source§fn clone(&self) -> CloseOptions
fn clone(&self) -> CloseOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CloseOptions
impl Debug for CloseOptions
Auto Trait Implementations§
impl Freeze for CloseOptions
impl RefUnwindSafe for CloseOptions
impl Send for CloseOptions
impl Sync for CloseOptions
impl Unpin for CloseOptions
impl UnsafeUnpin for CloseOptions
impl UnwindSafe for CloseOptions
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