Skip to main content

ShrinkFastGrowSlow

Struct ShrinkFastGrowSlow 

Source
pub struct ShrinkFastGrowSlow { /* private fields */ }
Expand description

FairShare’s division, applied asymmetrically: a cut lands at once, an increase is ramped at most step units per interval. The safety shape of a shared power or bandwidth budget — a holder must never be granted more than the budget can carry, so reductions cannot wait, while a holder drawing more can wait for the others to have backed off.

Implementations§

Source§

impl ShrinkFastGrowSlow

Source

pub const fn new(step: u32, interval: Duration) -> Self

A policy raising any grant by at most step units per interval.

Trait Implementations§

Source§

impl BudgetPolicy for ShrinkFastGrowSlow

Source§

fn divide( &self, capacity: u32, wants: &[u32], grants: &mut [u32], now: Instant, ) -> Option<Instant>

Write the new grants into grants, which arrives holding the previous division. Return when to run again while the division is converging, None once it is settled.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CouplingPoint for T
where T: Sync + ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.