Skip to main content

Bbr

Struct Bbr 

Source
pub struct Bbr { /* private fields */ }
Expand description

BBR sender-side state.

Implementations§

Source§

impl Bbr

Source

pub fn new(now: Instant, packet_bytes: u64) -> Self

Source

pub fn on_send(&mut self, now: Instant, app_limited: bool) -> PacketSample

Snapshot the rate-sample state for a packet about to be sent. The caller stores the returned PacketSample with the packet and returns it on delivery via on_ack.

Source

pub fn on_ack(&mut self, now: Instant, samples: &[PacketSample])

Process an ACK delivering samples (the snapshots of every packet newly known-received on this ACK, both the cumulative-ACK advance and any newly SACKed ids). The RTT is taken from the most recently sent acked packet, per the spec; picking that packet by its delivered snapshot also makes the rate sample robust to retransmits (a resent symbol keeps its old, low delivered, so it is never picked).

Source

pub fn pacing_rate_bps(&self) -> f64

Target pacing rate in bytes/second: pacing_gain * BtlBw, minus the 1% margin. Zero until the first reliable bandwidth sample lands (the caller should then fall back to its own flow control).

Source

pub fn cwnd_bytes(&self) -> u64

Target congestion window in bytes: cwnd_gain * BDP, floored at MIN_PIPE_CWND and reduced to PROBE_RTT_CWND during ProbeRTT.

Source

pub fn has_estimate(&self) -> bool

Whether a usable bandwidth estimate exists yet.

Source

pub fn btlbw_bps(&self) -> f64

BtlBw estimate (bytes/s), telemetry.

Auto Trait Implementations§

§

impl Freeze for Bbr

§

impl RefUnwindSafe for Bbr

§

impl Send for Bbr

§

impl Sync for Bbr

§

impl Unpin for Bbr

§

impl UnsafeUnpin for Bbr

§

impl UnwindSafe for Bbr

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.