pub struct PeerCongestionController {
pub peer_id: String,
pub window: u64,
pub ssthresh: u64,
pub state: CongestionState,
pub config: CongestionConfig,
pub total_acks: u64,
pub total_losses: u64,
}Expand description
Per-peer CUBIC-inspired congestion controller (legacy).
Fields§
§peer_id: StringIdentifier of the remote peer.
window: u64Current congestion window (bytes).
ssthresh: u64Slow-start threshold (bytes).
state: CongestionStateCurrent state of the congestion control state machine.
config: CongestionConfigConfiguration parameters.
total_acks: u64Total number of ACK events received.
total_losses: u64Total number of loss/ECN events received.
Implementations§
Source§impl PeerCongestionController
impl PeerCongestionController
Sourcepub fn new(peer_id: String, config: CongestionConfig) -> Self
pub fn new(peer_id: String, config: CongestionConfig) -> Self
Create a new controller for peer_id, starting in CongestionState::SlowStart.
Sourcepub fn on_event(&mut self, event: CongestionEvent)
pub fn on_event(&mut self, event: CongestionEvent)
Process a network event and update window / state accordingly.
Sourcepub fn window_stats(&self) -> WindowStats
pub fn window_stats(&self) -> WindowStats
Return a snapshot of the current window statistics.
Auto Trait Implementations§
impl Freeze for PeerCongestionController
impl RefUnwindSafe for PeerCongestionController
impl Send for PeerCongestionController
impl Sync for PeerCongestionController
impl Unpin for PeerCongestionController
impl UnsafeUnpin for PeerCongestionController
impl UnwindSafe for PeerCongestionController
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more