pub struct InflightBudget { /* private fields */ }Expand description
Global in-flight byte budget, shared by pipeline threads (which add on enqueue to sink queues) and sink workers (which subtract when a batch is acknowledged or abandoned).
This is a heuristic gauge, not a synchronization point: decisions taken
on a slightly stale reading are corrected on the next poll iteration and
absorbed by the controller’s hysteresis, so all operations use
Ordering::Relaxed. Atomic read-modify-write operations cannot lose
updates even under Relaxed (every RMW observes the latest value in the
modification order); relaxation only permits stale reads in
InflightBudget::usage, which the hysteresis absorbs. Both directions
saturate — sub can never underflow past zero even if an
acknowledgement races ahead of the bookkeeping that added its bytes.
Implementations§
Source§impl InflightBudget
impl InflightBudget
Trait Implementations§
Source§impl Debug for InflightBudget
impl Debug for InflightBudget
Source§impl Default for InflightBudget
impl Default for InflightBudget
Source§fn default() -> InflightBudget
fn default() -> InflightBudget
Auto Trait Implementations§
impl !Freeze for InflightBudget
impl RefUnwindSafe for InflightBudget
impl Send for InflightBudget
impl Sync for InflightBudget
impl Unpin for InflightBudget
impl UnsafeUnpin for InflightBudget
impl UnwindSafe for InflightBudget
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more