pub struct ConsumerCapacity {
pub max_in_flight: usize,
pub max_buffer_depth: usize,
}Expand description
Consumer-declared capacity limits for pressure-aware delivery.
Fields§
§max_in_flight: usizeMaximum messages this consumer can process concurrently.
max_buffer_depth: usizeMaximum messages that may wait for this consumer’s capacity to free.
Implementations§
Source§impl ConsumerCapacity
impl ConsumerCapacity
Sourcepub const fn new(
max_in_flight: usize,
max_buffer_depth: usize,
) -> Result<Self, CapacityError>
pub const fn new( max_in_flight: usize, max_buffer_depth: usize, ) -> Result<Self, CapacityError>
Creates a capacity declaration after verifying both limits are positive.
§Errors
Returns CapacityError::InvalidCapacity when either declared limit is zero.
Sourcepub const fn validate(&self) -> Result<(), CapacityError>
pub const fn validate(&self) -> Result<(), CapacityError>
Verifies that the declared capacity contains positive limits.
§Errors
Returns CapacityError::InvalidCapacity when either declared limit is zero.
Trait Implementations§
Source§impl Clone for ConsumerCapacity
impl Clone for ConsumerCapacity
Source§fn clone(&self) -> ConsumerCapacity
fn clone(&self) -> ConsumerCapacity
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 ConsumerCapacity
impl Debug for ConsumerCapacity
impl Eq for ConsumerCapacity
Source§impl PartialEq for ConsumerCapacity
impl PartialEq for ConsumerCapacity
Source§fn eq(&self, other: &ConsumerCapacity) -> bool
fn eq(&self, other: &ConsumerCapacity) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ConsumerCapacity
Auto Trait Implementations§
impl Freeze for ConsumerCapacity
impl RefUnwindSafe for ConsumerCapacity
impl Send for ConsumerCapacity
impl Sync for ConsumerCapacity
impl Unpin for ConsumerCapacity
impl UnsafeUnpin for ConsumerCapacity
impl UnwindSafe for ConsumerCapacity
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.