pub enum CandidateType {
Unspecified,
Host,
ServerReflexive,
PeerReflexive,
Relay,
}Expand description
Represents the type of candidate CandidateType enum.
Variants§
Unspecified
No candidate type was set.
Host
An address on one of this host’s own interfaces.
Highest priority: reachable without traversal when both peers share a network.
ServerReflexive
This host’s address as seen by a STUN server — its public mapping through the NAT.
PeerReflexive
An address learned from a peer’s inbound connectivity check.
Discovered during checking rather than gathering, when a NAT maps a different port per destination.
Relay
An address allocated on a TURN server, which forwards on this host’s behalf.
Lowest priority: it always costs an extra hop.
Implementations§
Source§impl CandidateType
impl CandidateType
Sourcepub const fn preference(self) -> u16
pub const fn preference(self) -> u16
Returns the preference weight of a CandidateType.
4.1.2.2. Guidelines for Choosing Type and Local Preferences The RECOMMENDED values are 126 for host candidates, 100 for server reflexive candidates, 110 for peer reflexive candidates, and 0 for relayed candidates.
Trait Implementations§
Source§impl Clone for CandidateType
impl Clone for CandidateType
Source§fn clone(&self) -> CandidateType
fn clone(&self) -> CandidateType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more