Skip to main content

CircuitBreakerHandle

Struct CircuitBreakerHandle 

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

The application’s view of the circuit breaker, and the only way a ceased flow restarts.

Implementations§

Source§

impl CircuitBreakerHandle

Source

pub fn new() -> Self

A handle with no interceptor yet: CircuitBreakerBuilder::build_with_handle builds the one it watches.

Source

pub fn state(&self, ssrc: u32) -> Option<CircuitBreakerState>

What the breaker is doing with the flow sent on ssrc, if it is bound.

Source

pub fn ceased(&self) -> Vec<(u32, CircuitBreakerReason)>

The flows that have ceased transmission, with the breaker that stopped each.

Source

pub fn rate_limit(&self) -> Option<f64>

The lowest rate any flow has been asked to stay under after the congestion breaker tripped, in bits per second. A congestion controller takes it as an upper bound.

Source

pub fn report_round_trip_time(&self, round_trip_time: Duration)

A round trip time measured from congestion-control feedback, for the breaker to use when it cannot measure one itself.

Tr is the RFC 3550 round trip time: a report block’s LSR and DLSR against the instant the named sender report left. The breaker only knows that instant for sender reports that pass it on the way out; when the RTCP session sits wire-ward of it (as the standard set places it) none does, and without Tr the congestion breaker could never compare the flow with TCP. The congestion controller’s feedback gives the same quantity many times a second.

Source

pub fn dropped(&self) -> u64

How many RTP packets of ceased flows were dropped.

Source

pub fn restart(&self, ssrc: u32, now: Instant) -> bool

Restart a ceased flow. Returns whether it restarted.

A flow is not restarted automatically (section 4.5): this is the application saying the congestion can be expected to have gone. It is refused until the interval that tripped the breaker has passed again, so the reaction to a tripped breaker lasts at least that long however often a restart is attempted.

Trait Implementations§

Source§

impl Clone for CircuitBreakerHandle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for CircuitBreakerHandle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.