Agent

Struct Agent 

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

ICE agent.

§Usage

  1. Get all components and prepare them for data/media transmission.
  2. Get the local credentials for all channels and send them over to a remote agent.
  3. Get all local candidates and send them over to the remote agent.
  4. Set remote credentials for all channels (required to be done before adding remote candidates).
  5. Add remote candidates.
  6. If there are no more remote candidates, conclude connectivity checks.

Implementations§

Source§

impl Agent

Source

pub fn builder(agent_role: AgentRole) -> AgentBuilder

Get an ICE agent builder.

Source

pub fn poll_next_local_candidate( &mut self, cx: &mut Context<'_>, ) -> Poll<Option<LocalCandidate>>

Get the next local candidate.

Source

pub async fn next_local_candidate(&mut self) -> Option<LocalCandidate>

Get the next local candidate.

Source

pub fn channels(&self) -> usize

Get the number of channels.

Source

pub fn get_local_credentials(&self, channel: usize) -> Credentials

Get local credentials of a given channel.

Source

pub fn get_remote_credentials(&self, channel: usize) -> Option<Credentials>

Get remote credentials of a given channel (if known).

Source

pub fn set_remote_credentials( &mut self, channel: usize, credentials: Credentials, )

Set remote credentials for a given channel.

Source

pub fn add_remote_candidate( &mut self, candidate: RemoteCandidate, username_fragment: Option<&str>, )

Add a given remote candidate.

§Panics

The method will panic if the remote credentials for the corresponding channel have not been set.

Auto Trait Implementations§

§

impl Freeze for Agent

§

impl !RefUnwindSafe for Agent

§

impl Send for Agent

§

impl Sync for Agent

§

impl Unpin for Agent

§

impl !UnwindSafe for Agent

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