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
fn new(_: Config) -> Self where Self: Sized
Method that constructs a new rate limiter using the provided configuration.
fn update(&mut self, rtt: u32, packet_loss: f32)
Method implementing a congestion avoidance algorithm based on round trip time and packet loss.
fn congested(&self) -> bool
Method that should return true
in case the connection is currently
considered congested and should reduce the number of packets it sends
per second.
fn should_send(&self) -> bool
Method that returns whether a connection should be currently sending packets or not.
fn reset(&mut self)
Method that resets any internal state of the rate limiter.
Trait Implementations
impl Debug for RateLimiter
[src]
Implementors
impl RateLimiter for BinaryRateLimiter