pub enum RateControlState {
Hold,
Increase,
Decrease,
}Expand description
What the rate controller should be doing.
Variants§
Hold
Hold the current rate — used immediately after a decrease, so the effect of the backoff can be observed before changing anything again.
Increase
Climb, looking for more capacity.
Decrease
Back off.
Implementations§
Source§impl RateControlState
impl RateControlState
Sourcepub fn next(self, usage: Usage) -> Self
pub fn next(self, usage: Usage) -> Self
The next state, given what the delay signal now says.
Pure: no clock, no rate, no history beyond the current state. That is what makes it exhaustively testable — the whole machine is nine transitions.
The asymmetry is deliberate and is the heart of AIMD: overuse always goes straight to
Decrease, from any state, because congestion is urgent; but recovery goes through
Hold first, so the rate does not resume climbing before the backoff has taken effect.
Trait Implementations§
Source§impl Clone for RateControlState
impl Clone for RateControlState
Source§fn clone(&self) -> RateControlState
fn clone(&self) -> RateControlState
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 moreimpl Copy for RateControlState
Source§impl Debug for RateControlState
impl Debug for RateControlState
Source§impl Default for RateControlState
impl Default for RateControlState
Source§fn default() -> RateControlState
fn default() -> RateControlState
Returns the “default value” for a type. Read more
impl Eq for RateControlState
Source§impl PartialEq for RateControlState
impl PartialEq for RateControlState
impl StructuralPartialEq for RateControlState
Auto Trait Implementations§
impl Freeze for RateControlState
impl RefUnwindSafe for RateControlState
impl Send for RateControlState
impl Sync for RateControlState
impl Unpin for RateControlState
impl UnsafeUnpin for RateControlState
impl UnwindSafe for RateControlState
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