pub struct LocalCandidate { /* private fields */ }Expand description
Local candidate.
Implementations§
Source§impl LocalCandidate
impl LocalCandidate
Sourcepub const fn calculate_priority(
component: u8,
kind: CandidateKind,
base: SocketAddr,
) -> u32
pub const fn calculate_priority( component: u8, kind: CandidateKind, base: SocketAddr, ) -> u32
Calculate local candidate priority for a given component ID, candidate type and the candidate base address.
Sourcepub const fn host(channel: usize, component: u8, addr: SocketAddr) -> Self
pub const fn host(channel: usize, component: u8, addr: SocketAddr) -> Self
Create a new host candidate.
Sourcepub const fn server_reflexive(
channel: usize,
component: u8,
base: SocketAddr,
addr: SocketAddr,
) -> Self
pub const fn server_reflexive( channel: usize, component: u8, base: SocketAddr, addr: SocketAddr, ) -> Self
Create a new server-reflexive candidate.
Sourcepub const fn peer_reflexive(
channel: usize,
component: u8,
base: SocketAddr,
addr: SocketAddr,
) -> Self
pub const fn peer_reflexive( channel: usize, component: u8, base: SocketAddr, addr: SocketAddr, ) -> Self
Create a new peer-reflexive candidate.
Sourcepub const fn relayed(channel: usize, component: u8, addr: SocketAddr) -> Self
pub const fn relayed(channel: usize, component: u8, addr: SocketAddr) -> Self
Create a new relayed candidate.
Sourcepub fn with_foundation(self, foundation: u32) -> Self
pub fn with_foundation(self, foundation: u32) -> Self
Create a new candidate with a given foundation value.
Sourcepub fn component(&self) -> u8
pub fn component(&self) -> u8
Get component ID of the component this candidate belongs to.
§Note
Unlike the component ID definition in RFC 5245, this component ID is zero-based. In order to get the RFC 5245 component ID (e.g. to create a session description), you need to add one to this number.
Sourcepub fn kind(&self) -> CandidateKind
pub fn kind(&self) -> CandidateKind
Get type of the candidate.
Sourcepub fn base(&self) -> SocketAddr
pub fn base(&self) -> SocketAddr
Get the base address.
Sourcepub fn addr(&self) -> SocketAddr
pub fn addr(&self) -> SocketAddr
Get the address.
Sourcepub fn foundation(&self) -> u32
pub fn foundation(&self) -> u32
Get the foundation.
Trait Implementations§
Source§impl Clone for LocalCandidate
impl Clone for LocalCandidate
Source§fn clone(&self) -> LocalCandidate
fn clone(&self) -> LocalCandidate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LocalCandidate
Auto Trait Implementations§
impl Freeze for LocalCandidate
impl RefUnwindSafe for LocalCandidate
impl Send for LocalCandidate
impl Sync for LocalCandidate
impl Unpin for LocalCandidate
impl UnwindSafe for LocalCandidate
Blanket Implementations§
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