pub struct CongestionController { /* private fields */ }Expand description
Congestion control manager.
Implementations§
Source§impl CongestionController
impl CongestionController
Sourcepub fn new(config: CongestionConfig) -> Self
pub fn new(config: CongestionConfig) -> Self
Create a new congestion controller.
Sourcepub fn report_success(&self, from: WorkerId, to: WorkerId, rtt_ms: f64)
pub fn report_success(&self, from: WorkerId, to: WorkerId, rtt_ms: f64)
Report successful transfer.
Sourcepub fn report_congestion(&self, from: WorkerId, to: WorkerId)
pub fn report_congestion(&self, from: WorkerId, to: WorkerId)
Report congestion event (packet loss, timeout).
Sourcepub fn get_window_size(&self, from: &WorkerId, to: &WorkerId) -> usize
pub fn get_window_size(&self, from: &WorkerId, to: &WorkerId) -> usize
Get current window size.
Sourcepub fn get_stats(&self) -> CongestionStats
pub fn get_stats(&self) -> CongestionStats
Get congestion statistics.
Auto Trait Implementations§
impl Freeze for CongestionController
impl !RefUnwindSafe for CongestionController
impl Send for CongestionController
impl Sync for CongestionController
impl Unpin for CongestionController
impl UnsafeUnpin for CongestionController
impl !UnwindSafe for CongestionController
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