webrtc_ice::udp_mux

Struct UDPMuxConn

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

A UDP mux connection.

Implementations§

Source§

impl UDPMuxConn

Source

pub fn new(params: UDPMuxConnParams) -> Self

Creates a new UDPMuxConn.

Source

pub fn key(&self) -> &str

Returns a key identifying this connection.

Source

pub async fn write_packet( &self, data: &[u8], addr: SocketAddr, ) -> Result<(), Error>

Writes data to the given address. Returns an error if the buffer is too short or there’s an encoding error.

Source

pub fn is_closed(&self) -> bool

Returns true if this connection is closed.

Source

pub fn close_rx(&self) -> Receiver<bool>

Gets a copy of the close tokio::sync::watch::Receiver that fires when this connection is closed.

Source

pub fn close(&self)

Closes this connection.

Source

pub fn get_addresses(&self) -> Vec<SocketAddr>

Gets the list of the addresses associated with this connection.

Source

pub async fn add_address(&self, addr: SocketAddr)

Registers a new address for this connection.

Source

pub fn remove_address(&self, addr: &SocketAddr)

Deregisters an address.

Source

pub fn contains_address(&self, addr: &SocketAddr) -> bool

Returns true if the given address is associated with this connection.

Trait Implementations§

Source§

impl Clone for UDPMuxConn

Source§

fn clone(&self) -> UDPMuxConn

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Conn for UDPMuxConn

Source§

fn connect<'life0, 'async_trait>( &'life0 self, _addr: SocketAddr, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn recv<'life0, 'life1, 'async_trait>( &'life0 self, _buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn recv_from<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<(usize, SocketAddr), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn send<'life0, 'life1, 'async_trait>( &'life0 self, _buf: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn send_to<'life0, 'life1, 'async_trait>( &'life0 self, buf: &'life1 [u8], target: SocketAddr, ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn local_addr(&self) -> Result<SocketAddr, Error>

Source§

fn remote_addr(&self) -> Option<SocketAddr>

Source§

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn as_any(&self) -> &(dyn Any + Send + Sync)

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> Same for T

Source§

type Output = T

Should always be Self
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 = 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.
Source§

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

Source§

fn vzip(self) -> V