pub struct Agent { /* private fields */ }Expand description
Represents the ICE agent.
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn get_candidate_pairs_stats(&self) -> Vec<CandidatePairStats>
pub fn get_candidate_pairs_stats(&self) -> Vec<CandidatePairStats>
Returns a list of candidate pair stats.
Sourcepub fn get_local_candidates_stats(&self) -> Vec<CandidateStats>
pub fn get_local_candidates_stats(&self) -> Vec<CandidateStats>
Returns a list of local candidates stats.
Sourcepub fn get_remote_candidates_stats(&self) -> Vec<CandidateStats>
pub fn get_remote_candidates_stats(&self) -> Vec<CandidateStats>
Returns a list of remote candidates stats.
Source§impl Agent
impl Agent
Sourcepub fn new(config: Arc<AgentConfig>) -> Result<Self>
pub fn new(config: Arc<AgentConfig>) -> Result<Self>
Creates a new Agent.
Sourcepub fn add_local_candidate(&mut self, c: Candidate) -> Result<()>
pub fn add_local_candidate(&mut self, c: Candidate) -> Result<()>
Adds a new local candidate.
Sourcepub fn add_remote_candidate(&mut self, c: Candidate) -> Result<()>
pub fn add_remote_candidate(&mut self, c: Candidate) -> Result<()>
Adds a new remote candidate.
Sourcepub fn set_remote_credentials(
&mut self,
remote_ufrag: String,
remote_pwd: String,
) -> Result<()>
pub fn set_remote_credentials( &mut self, remote_ufrag: String, remote_pwd: String, ) -> Result<()>
Sets the credentials of the remote agent.
Sourcepub fn get_remote_credentials(&self) -> Option<&Credentials>
pub fn get_remote_credentials(&self) -> Option<&Credentials>
Returns the remote credentials.
Sourcepub fn get_local_credentials(&self) -> &Credentials
pub fn get_local_credentials(&self) -> &Credentials
Returns the local credentials.
pub fn role(&self) -> bool
pub fn set_role(&mut self, is_controlling: bool)
pub fn state(&self) -> ConnectionState
pub fn is_valid_non_stun_traffic(&mut self, transport: TransportContext) -> bool
Sourcepub fn get_selected_candidate_pair(&self) -> Option<(&Candidate, &Candidate)>
pub fn get_selected_candidate_pair(&self) -> Option<(&Candidate, &Candidate)>
Returns the selected pair (local_candidate, remote_candidate) or none
pub fn get_best_available_candidate_pair( &self, ) -> Option<(&Candidate, &Candidate)>
Sourcepub fn start_connectivity_checks(
&mut self,
is_controlling: bool,
remote_ufrag: String,
remote_pwd: String,
) -> Result<()>
pub fn start_connectivity_checks( &mut self, is_controlling: bool, remote_ufrag: String, remote_pwd: String, ) -> Result<()>
start connectivity checks
Sourcepub fn restart(
&mut self,
ufrag: String,
pwd: String,
keep_local_candidates: bool,
) -> Result<()>
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.
Sourcepub fn get_local_candidates(&self) -> &[Candidate]
pub fn get_local_candidates(&self) -> &[Candidate]
Returns the local candidates.
Trait Implementations§
Source§impl Protocol<TransportMessage<BytesMut>, (), ()> for Agent
impl Protocol<TransportMessage<BytesMut>, (), ()> for Agent
Source§fn handle_read(&mut self, msg: TaggedBytesMut) -> Result<()>
fn handle_read(&mut self, msg: TaggedBytesMut) -> Result<()>
Handle an incoming read message. Read more
Source§fn handle_write(&mut self, _msg: ()) -> Result<(), Self::Error>
fn handle_write(&mut self, _msg: ()) -> Result<(), Self::Error>
Handle an outgoing write message. Read more
Source§fn handle_event(&mut self, _evt: ()) -> Result<(), Self::Error>
fn handle_event(&mut self, _evt: ()) -> Result<(), Self::Error>
Handle a custom event. Read more
Source§fn handle_timeout(&mut self, now: Self::Time) -> Result<(), Self::Error>
fn handle_timeout(&mut self, now: Self::Time) -> Result<(), Self::Error>
Handle a timeout event. 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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more