Struct webrtc_util::conn::conn_bridge::Bridge

source ·
pub struct Bridge { /* private fields */ }
Expand description

Bridge represents a network between the two endpoints.

Implementations§

source§

impl Bridge

source

pub fn new( loss_chance: u8, filter_cb0: Option<FilterCbFn>, filter_cb1: Option<FilterCbFn> ) -> (Arc<Bridge>, impl Conn, impl Conn)

source

pub async fn len(&self, id: usize) -> usize

Len returns number of queued packets.

source

pub async fn push(&self, b: &[u8], id: usize) -> Result<usize>

source

pub async fn reorder(&self, id: usize) -> bool

Reorder inverses the order of packets currently in the specified queue.

source

pub async fn drop_offset(&self, id: usize, offset: usize, n: usize)

Drop drops the specified number of packets from the given offset index of the specified queue.

source

pub fn drop_next_nwrites(&self, id: usize, n: usize)

drop_next_nwrites drops the next n packets that will be written to the specified queue.

source

pub fn reorder_next_nwrites(&self, id: usize, n: usize)

reorder_next_nwrites drops the next n packets that will be written to the specified queue.

source

pub async fn clear(&self)

source

pub async fn tick(&self) -> usize

Tick attempts to hand a packet from the queue for each directions, to readers, if there are waiting on the queue. If there’s no reader, it will return immediately.

source

pub async fn process(&self)

Process repeats tick() calls until no more outstanding packet in the queues.

Trait Implementations§

source§

impl Default for Bridge

source§

fn default() -> Bridge

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

Auto Trait Implementations§

§

impl !Freeze for Bridge

§

impl !RefUnwindSafe for Bridge

§

impl Send for Bridge

§

impl Sync for Bridge

§

impl Unpin for Bridge

§

impl !UnwindSafe for Bridge

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>,

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V