Skip to main content

IceAgent

Struct IceAgent 

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

The ICE agent state machine

Implementations§

Source§

impl IceAgent

Source

pub fn new_from_answer( local_credentials: IceCredentials, remote_credentials: IceCredentials, is_controlling: bool, rtcp_mux: bool, ) -> Self

Source

pub fn new_for_offer( local_credentials: IceCredentials, is_controlling: bool, rtcp_mux: bool, ) -> Self

Source

pub fn set_remote_data( &mut self, credentials: IceCredentials, candidates: &[IceCandidate], rtcp_mux: bool, )

Set all the remote information in one step. This function is usually set once after receiving a SDP answer.

Source

pub fn credentials(&self) -> &IceCredentials

Return the ice-agent’s ice credentials

Source

pub fn add_host_addr(&mut self, component: Component, addr: SocketAddr)

Register a host address for a given ICE component. This will be used to create a host candidate. For the ICE agent to work properly, all available ip addresses of the host system should be provided.

Source

pub fn add_stun_server(&mut self, server: SocketAddr)

Add a STUN server which the ICE agent should use to gather additional (server-reflexive) candidates.

Source

pub fn gathering_state(&self) -> IceGatheringState

Returns the current ICE candidate gathering state

Source

pub fn connection_state(&self) -> IceConnectionState

Returns the current ICE connection state

Source

pub fn discovered_addr( &self, component: Component, ) -> Option<(SocketAddr, SocketAddr)>

Returns the discovered local & remote address for the given component

Source

pub fn add_remote_candidate(&mut self, candidate: &IceCandidate)

Add a peer’s ice-candidate which has been received using an extern signaling protocol

Source

pub fn receive(&mut self, now: Instant, pkt: ReceivedPkt)

Receive network packets for this ICE agent

Source

pub fn poll(&mut self, now: Instant)

Drive the ICE agent forward. This must be called after the duration returned by timeout.

Source

pub fn pop_event(&mut self) -> Option<IceEvent>

Returns the next event to process

This must be called until it returns None

Source

pub fn timeout(&self, now: Instant) -> Option<Duration>

Returns a duration after which to call poll

Source

pub fn ice_candidates(&self) -> Vec<IceCandidate>

Returns all discovered local ice agents, does not include peer-reflexive candidates

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> Same for T

Source§

type Output = T

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

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

Source§

fn vzip(self) -> V