Trait cobalt::RateLimiter [] [src]

pub trait RateLimiter {
    fn new(_: Config) -> Self where Self: Sized;
    fn update(&mut self, rtt: u32, packet_loss: f32);
    fn congested(&self) -> bool;
    fn should_send(&self) -> bool;
    fn reset(&mut self);
}

Trait describing a network congestion avoidance algorithm.

Required Methods

Method that constructs a new rate limiter using the provided configuration.

Method implementing a congestion avoidance algorithm based on round trip time and packet loss.

Method that should return true in case the connection is currently considered congested and should reduce the number of packets it sends per second.

Method that returns whether a connection should be currently sending packets or not.

Method that resets any internal state of the rate limiter.

Trait Implementations

impl Debug for RateLimiter
[src]

Formats the value using the given formatter.

Implementors