pub struct ConsumerCapacity {
pub max_in_flight: usize,
pub max_buffer_depth: usize,
}Expand description
Consumer-declared capacity limits for pressure-aware delivery.
Copy because it is two usizes: it is passed by value through the
admission path and the depth-cap clamp, and cloning a pair of integers
to read them is noise. Additive.
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
impl Copy for ConsumerCapacity
Source§impl Debug for ConsumerCapacity
impl Debug for ConsumerCapacity
impl Eq for ConsumerCapacity
Source§impl PartialEq for ConsumerCapacity
impl PartialEq for ConsumerCapacity
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.