Struct Cubic
pub struct Cubic { /* private fields */ }Expand description
The RFC8312 congestion controller, as widely used for TCP
Implementations§
Trait Implementations§
§impl Controller for Cubic
impl Controller for Cubic
§fn on_ack(
&mut self,
now: Instant,
sent: Instant,
bytes: u64,
_pn: u64,
app_limited: bool,
rtt: &RttEstimator,
)
fn on_ack( &mut self, now: Instant, sent: Instant, bytes: u64, _pn: u64, app_limited: bool, rtt: &RttEstimator, )
Packet deliveries were confirmed Read more
§fn on_congestion_event(
&mut self,
now: Instant,
sent: Instant,
is_persistent_congestion: bool,
is_ecn: bool,
_lost_bytes: u64,
_largest_lost_pn: u64,
)
fn on_congestion_event( &mut self, now: Instant, sent: Instant, is_persistent_congestion: bool, is_ecn: bool, _lost_bytes: u64, _largest_lost_pn: u64, )
Packets were deemed lost or marked congested Read more
§fn on_spurious_congestion_event(&mut self)
fn on_spurious_congestion_event(&mut self)
Packets were incorrectly deemed lost Read more
§fn on_mtu_update(&mut self, new_mtu: u16)
fn on_mtu_update(&mut self, new_mtu: u16)
The known MTU for the current network path has been updated
§fn metrics(&self) -> ControllerMetrics
fn metrics(&self) -> ControllerMetrics
Retrieve implementation-specific metrics used to populate
qlog traces when they are enabled
This is also used to alter the pacing of the connection with
pacing_rate and send_quantum§fn clone_box(&self) -> Box<dyn Controller>
fn clone_box(&self) -> Box<dyn Controller>
Duplicate the controller’s state
§fn initial_window(&self) -> u64
fn initial_window(&self) -> u64
Initial congestion window
§fn into_any(self: Box<Cubic>) -> Box<dyn Any>
fn into_any(self: Box<Cubic>) -> Box<dyn Any>
Returns Self for use in down-casting to extract implementation details
§fn on_packet_sent(&mut self, now: Instant, bytes: u16, pn: u64)
fn on_packet_sent(&mut self, now: Instant, bytes: u16, pn: u64)
One packet was just sent
§fn on_end_acks(
&mut self,
now: Instant,
in_flight: u64,
app_limited: bool,
largest_packet_num_acked: Option<u64>,
)
fn on_end_acks( &mut self, now: Instant, in_flight: u64, app_limited: bool, largest_packet_num_acked: Option<u64>, )
Packets are acked in batches, all with the same
now argument. This indicates one of those batches has completed.§fn on_packet_lost(&mut self, lost_bytes: u16, pn: u64, now: Instant)
fn on_packet_lost(&mut self, lost_bytes: u16, pn: u64, now: Instant)
One packet was just lost
§fn on_ack_frequency_update(
&mut self,
ack_eliciting_threshold: u64,
requested_max_ack_delay: Duration,
)
fn on_ack_frequency_update( &mut self, ack_eliciting_threshold: u64, requested_max_ack_delay: Duration, )
The peer’s ACK-frequency parameters have changed Read more
Auto Trait Implementations§
impl Freeze for Cubic
impl RefUnwindSafe for Cubic
impl Send for Cubic
impl Sync for Cubic
impl Unpin for Cubic
impl UnwindSafe for Cubic
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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