pub struct CandidatePair {
pub local_index: usize,
pub remote_index: usize,
pub local_priority: u32,
pub remote_priority: u32,
/* private fields */
}Expand description
Represents a combination of a local and remote candidate.
Fields§
§local_index: usizeIndex of the local candidate in the agent’s list.
remote_index: usizeIndex of the remote candidate in the agent’s list.
local_priority: u32The local candidate’s priority.
remote_priority: u32The remote candidate’s priority.
Implementations§
Source§impl CandidatePair
impl CandidatePair
Sourcepub fn new(
local_index: usize,
remote_index: usize,
local_priority: u32,
remote_priority: u32,
ice_role_controlling: bool,
) -> Self
pub fn new( local_index: usize, remote_index: usize, local_priority: u32, remote_priority: u32, ice_role_controlling: bool, ) -> Self
Forms a pair from a local and a remote candidate.
controlling selects which priority dominates in the pair’s combined priority.
Sourcepub fn priority(&self) -> u64
pub fn priority(&self) -> u64
RFC 5245 - 5.7.2. Computing Pair Priority and Ordering Pairs Let G be the priority for the candidate provided by the controlling agent. Let D be the priority for the candidate provided by the controlled agent. pair priority = 2^32MIN(G,D) + 2MAX(G,D) + (G>D?1:0)
Sourcepub fn on_request_sent(&mut self)
pub fn on_request_sent(&mut self)
Called when a STUN binding request is sent.
Sourcepub fn on_request_received(&mut self)
pub fn on_request_received(&mut self)
Called when a STUN binding request is received.
Sourcepub fn on_response_sent(&mut self)
pub fn on_response_sent(&mut self)
Called when a STUN binding success response is sent.
Sourcepub fn on_response_received(&mut self, rtt: Duration)
pub fn on_response_received(&mut self, rtt: Duration)
Called when a STUN binding success response is received. Also updates RTT measurements.
Sourcepub fn on_consent_request_sent(&mut self)
pub fn on_consent_request_sent(&mut self)
Called when a consent freshness request is sent (keepalive).
Trait Implementations§
Source§impl Clone for CandidatePair
impl Clone for CandidatePair
Source§fn clone(&self) -> CandidatePair
fn clone(&self) -> CandidatePair
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more