pub struct ConsumerStateView {
pub consumer: ConsumerId,
pub current_in_flight: u32,
pub max_in_flight: u32,
pub buffer_depth: u32,
pub affinity_tags: Vec<String>,
}Expand description
Per-consumer state presented to a routing function during execution.
Fields§
§consumer: ConsumerIdConsumer the state describes.
current_in_flight: u32Messages currently in flight to the consumer.
max_in_flight: u32Maximum messages the consumer will accept in flight.
buffer_depth: u32Depth of the consumer’s pending buffer.
Affinity tags advertised by the consumer.
Implementations§
Source§impl ConsumerStateView
impl ConsumerStateView
Sourcepub const fn new(
consumer: ConsumerId,
current_in_flight: u32,
max_in_flight: u32,
buffer_depth: u32,
affinity_tags: Vec<String>,
) -> Self
pub const fn new( consumer: ConsumerId, current_in_flight: u32, max_in_flight: u32, buffer_depth: u32, affinity_tags: Vec<String>, ) -> Self
Creates a consumer state view.
Sourcepub const fn available_capacity(&self) -> u32
pub const fn available_capacity(&self) -> u32
Returns the remaining in-flight capacity of the consumer.
Sourcepub const fn has_capacity(&self) -> bool
pub const fn has_capacity(&self) -> bool
Returns true when the consumer can accept at least one more message.
Sourcepub fn has_affinity(&self, tag: &str) -> bool
pub fn has_affinity(&self, tag: &str) -> bool
Returns true when the consumer advertises tag.
Trait Implementations§
Source§impl Clone for ConsumerStateView
impl Clone for ConsumerStateView
Source§fn clone(&self) -> ConsumerStateView
fn clone(&self) -> ConsumerStateView
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 moreSource§impl Debug for ConsumerStateView
impl Debug for ConsumerStateView
impl Eq for ConsumerStateView
Source§impl PartialEq for ConsumerStateView
impl PartialEq for ConsumerStateView
Source§fn eq(&self, other: &ConsumerStateView) -> bool
fn eq(&self, other: &ConsumerStateView) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ConsumerStateView
Auto Trait Implementations§
impl Freeze for ConsumerStateView
impl RefUnwindSafe for ConsumerStateView
impl Send for ConsumerStateView
impl Sync for ConsumerStateView
impl Unpin for ConsumerStateView
impl UnsafeUnpin for ConsumerStateView
impl UnwindSafe for ConsumerStateView
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.