Agent

Struct Agent 

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

Represents the ICE agent.

Implementations§

Source§

impl Agent

Source

pub fn get_candidate_pairs_stats(&self) -> Vec<CandidatePairStats>

Returns a list of candidate pair stats.

Source

pub fn get_local_candidates_stats(&self) -> Vec<CandidateStats>

Returns a list of local candidates stats.

Source

pub fn get_remote_candidates_stats(&self) -> Vec<CandidateStats>

Returns a list of remote candidates stats.

Source§

impl Agent

Source

pub fn new(config: Arc<AgentConfig>) -> Result<Self>

Creates a new Agent.

Source

pub fn add_local_candidate(&mut self, c: Candidate) -> Result<()>

Adds a new local candidate.

Source

pub fn add_remote_candidate(&mut self, c: Candidate) -> Result<()>

Adds a new remote candidate.

Source

pub fn set_remote_credentials( &mut self, remote_ufrag: String, remote_pwd: String, ) -> Result<()>

Sets the credentials of the remote agent.

Source

pub fn get_remote_credentials(&self) -> Option<&Credentials>

Returns the remote credentials.

Source

pub fn get_local_credentials(&self) -> &Credentials

Returns the local credentials.

Source

pub fn role(&self) -> bool

Source

pub fn set_role(&mut self, is_controlling: bool)

Source

pub fn state(&self) -> ConnectionState

Source

pub fn is_valid_non_stun_traffic(&mut self, transport: TransportContext) -> bool

Source

pub fn get_selected_candidate_pair(&self) -> Option<(&Candidate, &Candidate)>

Returns the selected pair (local_candidate, remote_candidate) or none

Source

pub fn get_best_available_candidate_pair( &self, ) -> Option<(&Candidate, &Candidate)>

Source

pub fn start_connectivity_checks( &mut self, is_controlling: bool, remote_ufrag: String, remote_pwd: String, ) -> Result<()>

start connectivity checks

Source

pub fn restart( &mut self, ufrag: String, pwd: String, keep_local_candidates: bool, ) -> Result<()>

Restarts the ICE Agent with the provided ufrag/pwd If no ufrag/pwd is provided the Agent will generate one itself.

Source

pub fn get_local_candidates(&self) -> &[Candidate]

Returns the local candidates.

Trait Implementations§

Source§

impl Default for Agent

Source§

fn default() -> Self

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

impl Protocol<TransportMessage<BytesMut>, (), ()> for Agent

Source§

type Rout = TransportMessage<BytesMut>

Output read message type Read more
Source§

type Wout = TransportMessage<BytesMut>

Output write message type Read more
Source§

type Eout = Event

Output event type Read more
Source§

type Error = Error

Error type for protocol operations
Source§

type Time = Instant

Time/Instant type for timeout handling Read more
Source§

fn handle_read(&mut self, msg: TaggedBytesMut) -> Result<()>

Handle an incoming read message. Read more
Source§

fn poll_read(&mut self) -> Option<Self::Rout>

Poll for a processed read message. Read more
Source§

fn handle_write(&mut self, _msg: ()) -> Result<(), Self::Error>

Handle an outgoing write message. Read more
Source§

fn poll_write(&mut self) -> Option<Self::Wout>

Poll for a processed write message. Read more
Source§

fn handle_event(&mut self, _evt: ()) -> Result<(), Self::Error>

Handle a custom event. Read more
Source§

fn poll_event(&mut self) -> Option<Self::Eout>

Poll for a generated event. Read more
Source§

fn handle_timeout(&mut self, now: Self::Time) -> Result<(), Self::Error>

Handle a timeout event. Read more
Source§

fn poll_timeout(&mut self) -> Option<Self::Time>

Poll for the next timeout deadline. Read more
Source§

fn close(&mut self) -> Result<(), Self::Error>

Close the protocol. Read more

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,