Skip to main content

GccInterceptorBuilder

Struct GccInterceptorBuilder 

Source
pub struct GccInterceptorBuilder<P> { /* private fields */ }
Expand description

Builder for GccInterceptor.

Create with GccInterceptorBuilder::new, which returns (builder, handle).

Implementations§

Source§

impl<P> GccInterceptorBuilder<P>

Source

pub fn new() -> (Self, GccHandle)

Create a new builder and the associated GccHandle.

The handle can be shared with the application so it can read the latest bitrate estimate each polling tick.

Source

pub fn with_min_bitrate(self, bps: u32) -> Self

Minimum send rate floor (default 30 kbps).

Source

pub fn with_max_bitrate(self, bps: u32) -> Self

Maximum send rate ceiling (default 2.5 Mbps).

Source

pub fn with_received_rate_bound( self, received_rate_bound: ReceivedRateBound, ) -> Self

What the bound of the estimate by the received rate does to an estimate above it (Gcc::with_received_rate_bound): by default it only stops the increase, so the estimate is kept while the application sends less than it.

Source

pub fn with_bandwidth_probing(self, bandwidth_probing: bool) -> Self

Whether the path is probed for capacity above the estimate (the default), as the peer connection’s default interceptors do (CongestionControlBuilder::with_bandwidth_probing): two clusters at the start, at three and six times the 300 kbit/s the estimate starts at, and further ones while the path carries what is asked, so an open path is found within a second instead of by the 8% a second of draft-ietf-rmcat-gcc-02 section 5.5 (300 kbit/s to 2.5 Mbit/s: 28 s). RFC 8836 section 2, requirement 4: the algorithm “SHOULD adapt as quickly as possible to initial network conditions at the start of a flow”.

This chain has no pacer. A cluster is the NACK responder’s padding on the RTX stream, sent as one burst and measured by how far apart the path delivers it (burst_estimate); it needs a NackResponderInterceptor in the chain and RTX negotiated for the stream. Without them no cluster can be sent: the first one asked for goes unanswered and no more are asked, and the estimate climbs as the draft has it. Clusters are asked for at the start and while the application sends less than the target allows; not after a large drop of the target, which a chain with the pacer probes too (a burst of padding into the queue that caused the drop costs more than it finds: ProbeController::set_unpaced).

A call that finds the path’s rate at the start meets a later capacity collapse from that rate, and loses more at it than one that was still climbing (about twice the retransmissions when 2.5 Mbit/s drop to 300 kbit/s; the changelog has the measured figures). with_bandwidth_probing(false) is the start without probes.

Source

pub fn build(self) -> impl FnOnce(P) -> GccInterceptor<P>

Build the interceptor factory closure.

Auto Trait Implementations§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.