pub struct Candidate { /* private fields */ }Expand description
One ICE candidate: a transport address this agent can be reached at, or can reach a peer at, together with its type, priority and liveness bookkeeping.
Implementations§
Source§impl Candidate
impl Candidate
Sourcepub fn foundation(&self) -> String
pub fn foundation(&self) -> String
The candidate’s foundation, computed from its type, base address and transport.
Sourcepub fn set_component(&mut self, component: u16)
pub fn set_component(&mut self, component: u16)
Sets candidate component.
Sourcepub fn last_received(&self) -> Instant
pub fn last_received(&self) -> Instant
Returns a time indicating the last time this candidate was received.
Sourcepub fn last_sent(&self) -> Instant
pub fn last_sent(&self) -> Instant
Returns a time indicating the last time this candidate was sent.
Sourcepub fn network_type(&self) -> NetworkType
pub fn network_type(&self) -> NetworkType
Returns candidate NetworkType.
Returns Option<CandidateRelatedAddress>.
Sourcepub fn candidate_type(&self) -> CandidateType
pub fn candidate_type(&self) -> CandidateType
Returns candidate type.
Sourcepub fn url(&self) -> Option<&str>
pub fn url(&self) -> Option<&str>
The STUN or TURN server this candidate was gathered from, if any.
Sourcepub fn addr(&self) -> SocketAddr
pub fn addr(&self) -> SocketAddr
The candidate’s socket address.
Sourcepub fn base_addr(&self) -> SocketAddr
pub fn base_addr(&self) -> SocketAddr
Returns the candidate’s base address: the local transport address the candidate was derived from, i.e. the address packets for this candidate must be sent from (RFC 8445 §5.1.1).
For server-reflexive and peer-reflexive candidates this is the related (host) address; for host and relay candidates the base is the candidate address itself.
Source§impl Candidate
impl Candidate
Sourcepub fn set_last_received(&mut self, now: Instant)
pub fn set_last_received(&mut self, now: Instant)
Records that traffic was received on this candidate at now.
Sourcepub fn set_last_sent(&mut self, now: Instant)
pub fn set_last_sent(&mut self, now: Instant)
Records that traffic was sent on this candidate at now.
Sourcepub fn local_preference(&self) -> u16
pub fn local_preference(&self) -> u16
Returns the local preference for this candidate.