pub struct ConsumerGroup { /* private fields */ }Expand description
A consumer group modeled as a routing function over a mutable consumer set.
Implementations§
Source§impl ConsumerGroup
impl ConsumerGroup
Sourcepub fn new(routing_function: RoutingFunction) -> Self
pub fn new(routing_function: RoutingFunction) -> Self
Creates a consumer group with no active consumers.
Sourcepub fn routing_function(&self) -> RoutingFunction
pub fn routing_function(&self) -> RoutingFunction
Returns the routing function associated with this group.
Sourcepub fn consumers(&self) -> Vec<ConsumerId>
pub fn consumers(&self) -> Vec<ConsumerId>
Returns the ordered, deduplicated active consumer identifiers.
Sourcepub fn snapshot(&self) -> ConsumerGroupSnapshot
pub fn snapshot(&self) -> ConsumerGroupSnapshot
Returns a stable dispatch-boundary snapshot of the group.
Sourcepub fn add_consumer(&self, registration: ConsumerRegistration) -> bool
pub fn add_consumer(&self, registration: ConsumerRegistration) -> bool
Adds or updates a consumer, returning true when the id was newly inserted.
Sourcepub fn remove_consumer(&self, consumer: &ConsumerId) -> bool
pub fn remove_consumer(&self, consumer: &ConsumerId) -> bool
Removes a consumer from future group snapshots.
Trait Implementations§
Source§impl Clone for ConsumerGroup
impl Clone for ConsumerGroup
Source§fn clone(&self) -> ConsumerGroup
fn clone(&self) -> ConsumerGroup
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ConsumerGroup
impl !UnwindSafe for ConsumerGroup
impl Freeze for ConsumerGroup
impl Send for ConsumerGroup
impl Sync for ConsumerGroup
impl Unpin for ConsumerGroup
impl UnsafeUnpin for ConsumerGroup
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