pub struct MultiPeerCongestionManager {
pub controllers: HashMap<String, PeerCongestionController>,
pub config: CongestionConfig,
}Expand description
Manages PeerCongestionController instances for multiple peers (legacy).
Fields§
§controllers: HashMap<String, PeerCongestionController>Per-peer controllers, keyed by peer ID string.
config: CongestionConfigDefault configuration applied to newly created controllers.
Implementations§
Source§impl MultiPeerCongestionManager
impl MultiPeerCongestionManager
Sourcepub fn new(config: CongestionConfig) -> Self
pub fn new(config: CongestionConfig) -> Self
Create a new manager with the given default configuration.
Sourcepub fn get_or_create(&mut self, peer_id: &str) -> &mut PeerCongestionController
pub fn get_or_create(&mut self, peer_id: &str) -> &mut PeerCongestionController
Return a mutable reference to the controller for peer_id.
Sourcepub fn on_event(&mut self, peer_id: &str, event: CongestionEvent)
pub fn on_event(&mut self, peer_id: &str, event: CongestionEvent)
Deliver a congestion event to the controller for peer_id.
Sourcepub fn remove_peer(&mut self, peer_id: &str) -> bool
pub fn remove_peer(&mut self, peer_id: &str) -> bool
Remove the controller for peer_id.
Sourcepub fn total_window(&self) -> u64
pub fn total_window(&self) -> u64
Return the sum of all managed peer windows.
Auto Trait Implementations§
impl Freeze for MultiPeerCongestionManager
impl RefUnwindSafe for MultiPeerCongestionManager
impl Send for MultiPeerCongestionManager
impl Sync for MultiPeerCongestionManager
impl Unpin for MultiPeerCongestionManager
impl UnsafeUnpin for MultiPeerCongestionManager
impl UnwindSafe for MultiPeerCongestionManager
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