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<bool>
pub fn add_local_candidate(&mut self, c: Candidate) -> Result<bool>
Adds a new local candidate.
Sourcepub fn add_remote_candidate(&mut self, c: Candidate) -> Result<bool>
pub fn add_remote_candidate(&mut self, c: Candidate) -> Result<bool>
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.
Sourcepub fn role(&self) -> bool
pub fn role(&self) -> bool
Whether this agent is the controlling one, which decides nomination.
Sourcepub fn set_role(&mut self, is_controlling: bool)
pub fn set_role(&mut self, is_controlling: bool)
Sets the controlling role.
Determined by which side offered; the two agents must not agree, or nomination stalls.
Sourcepub fn state(&self) -> ConnectionState
pub fn state(&self) -> ConnectionState
The agent’s current connection state.
Sourcepub fn is_valid_non_stun_traffic(&mut self, transport: TransportContext) -> bool
pub fn is_valid_non_stun_traffic(&mut self, transport: TransportContext) -> bool
Whether a non-STUN datagram on transport should be accepted as media.
Guards against accepting media from an address that has not passed a connectivity check.
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
Sourcepub fn get_best_available_candidate_pair(
&self,
) -> Option<(&Candidate, &Candidate)>
pub fn get_best_available_candidate_pair( &self, ) -> Option<(&Candidate, &Candidate)>
The highest-priority pair that is still usable, whether or not it has been nominated.
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.