pub struct CubicCongestionController { /* private fields */ }
Expand description
A congestion controller that implements “CUBIC for Fast Long-Distance Networks” as specified in https://tools.ietf.org/html/rfc8312. The Hybrid Slow Start algorithm is used for determining the slow start threshold.
Implementations
sourceimpl CubicCongestionController
impl CubicCongestionController
pub fn new(max_datagram_size: u16) -> CubicCongestionController
Trait Implementations
sourceimpl Clone for CubicCongestionController
impl Clone for CubicCongestionController
sourcefn clone(&self) -> CubicCongestionController
fn clone(&self) -> CubicCongestionController
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl CongestionController for CubicCongestionController
impl CongestionController for CubicCongestionController
sourcefn congestion_window(&self) -> u32
fn congestion_window(&self) -> u32
Returns the size of the current congestion window in bytes
sourcefn bytes_in_flight(&self) -> u32
fn bytes_in_flight(&self) -> u32
Returns the current bytes in flight
sourcefn is_congestion_limited(&self) -> bool
fn is_congestion_limited(&self) -> bool
Returns true
if the congestion window does not have sufficient
space for a packet of max_datagram_size
considering the current
bytes in flight Read more
sourcefn requires_fast_retransmission(&self) -> bool
fn requires_fast_retransmission(&self) -> bool
Returns true
if the current state of the congestion controller
requires a packet to be transmitted without respecting the
available congestion window Read more
sourcefn on_packet_sent(
&mut self,
time_sent: Timestamp,
bytes_sent: usize,
rtt_estimator: &RttEstimator
)
fn on_packet_sent(
&mut self,
time_sent: Timestamp,
bytes_sent: usize,
rtt_estimator: &RttEstimator
)
Invoked whenever a congestion controlled packet is sent
sourcefn on_rtt_update(&mut self, time_sent: Timestamp, rtt_estimator: &RttEstimator)
fn on_rtt_update(&mut self, time_sent: Timestamp, rtt_estimator: &RttEstimator)
Invoked each time the round trip time is updated, which is whenever the largest acknowledged packet in an ACK frame is newly acknowledged Read more
sourcefn on_packet_ack(
&mut self,
largest_acked_time_sent: Timestamp,
sent_bytes: usize,
rtt_estimator: &RttEstimator,
ack_receive_time: Timestamp
)
fn on_packet_ack(
&mut self,
largest_acked_time_sent: Timestamp,
sent_bytes: usize,
rtt_estimator: &RttEstimator,
ack_receive_time: Timestamp
)
Invoked for each newly acknowledged packet
sourcefn on_packets_lost(
&mut self,
lost_bytes: u32,
persistent_congestion: bool,
timestamp: Timestamp
)
fn on_packets_lost(
&mut self,
lost_bytes: u32,
persistent_congestion: bool,
timestamp: Timestamp
)
Invoked when packets are declared lost
sourcefn on_congestion_event(&mut self, event_time: Timestamp)
fn on_congestion_event(&mut self, event_time: Timestamp)
Invoked from on_packets_lost, but is also directly invoked when the Explicit Congestion Notification counter increases. Read more
sourcefn on_mtu_update(&mut self, max_datagram_size: u16)
fn on_mtu_update(&mut self, max_datagram_size: u16)
Invoked when the path maximum transmission unit is updated.
sourcefn on_packet_discarded(&mut self, bytes_sent: usize)
fn on_packet_discarded(&mut self, bytes_sent: usize)
Invoked for each packet discarded when a packet number space is discarded.
sourcefn earliest_departure_time(&self) -> Option<Timestamp>
fn earliest_departure_time(&self) -> Option<Timestamp>
Returns the earliest time that a packet may be transmitted. Read more
Auto Trait Implementations
impl RefUnwindSafe for CubicCongestionController
impl Send for CubicCongestionController
impl Sync for CubicCongestionController
impl Unpin for CubicCongestionController
impl UnwindSafe for CubicCongestionController
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more