pub struct Vegas { /* private fields */ }Available on crate feature
adaptive only.Expand description
Latency-based adaptation, after TCP Vegas.
From the round-trip time it estimates the queue depth at the downstream —
limit * (rtt - min_rtt) / rtt, where min_rtt is the best (no-load) latency
seen so far. A small estimated queue means there is headroom, so the limit
grows; a large one means a queue is forming, so it shrinks. Failures halve the
limit outright.
§Examples
use throttle_net::{AdaptiveLimiter, Vegas};
// Grow while the estimated queue is below 3, shrink above 6.
let limiter = AdaptiveLimiter::builder()
.floor(2)
.ceiling(100)
.build(Vegas::new(3, 6));Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Vegas
impl RefUnwindSafe for Vegas
impl Send for Vegas
impl Sync for Vegas
impl Unpin for Vegas
impl UnsafeUnpin for Vegas
impl UnwindSafe for Vegas
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