pub struct Candidate { /* private fields */ }Expand description
An ICE candidate.
Implementations§
Source§impl Candidate
impl Candidate
Sourcepub fn builder(
component_id: usize,
ctype: CandidateType,
ttype: TransportType,
foundation: &str,
address: Address,
) -> CandidateBuilder
pub fn builder( component_id: usize, ctype: CandidateType, ttype: TransportType, foundation: &str, address: Address, ) -> CandidateBuilder
Builds the candidate
§Examples
let addr: Address = "127.0.0.1:2345".parse().unwrap();
let candidate = Candidate::builder(
1,
CandidateType::Host,
TransportType::Udp,
"foundation",
addr,
)
.priority(1234)
.build();
assert_eq!(candidate.to_sdp_string(), "a=candidate:foundation 1 UDP 1234 127.0.0.1 2345 typ host")Sourcepub fn to_owned(&self) -> CandidateOwned
pub fn to_owned(&self) -> CandidateOwned
Copy this candidate into a heap allocated CandidateOwned.
Sourcepub fn to_sdp_string(&self) -> String
pub fn to_sdp_string(&self) -> String
Serialize this candidate to a string for use in SDP
§Examples
let addr: Address = "127.0.0.1:2345".parse().unwrap();
let candidate = Candidate::builder(
1,
CandidateType::Host,
TransportType::Udp,
"foundation",
addr,
)
.priority(1234)
.build();
assert_eq!(candidate.to_sdp_string(), "a=candidate:foundation 1 UDP 1234 127.0.0.1 2345 typ host")Sourcepub fn from_sdp_string(s: &str) -> Result<Candidate, ParseCandidateError>
pub fn from_sdp_string(s: &str) -> Result<Candidate, ParseCandidateError>
Parse an SDP candidate string into a candidate.
Trait Implementations§
Source§impl CandidateApi for Candidate
impl CandidateApi for Candidate
Source§fn component_id(&self) -> usize
fn component_id(&self) -> usize
The component
Source§fn candidate_type(&self) -> CandidateType
fn candidate_type(&self) -> CandidateType
The type of the Candidate
Source§fn transport(&self) -> TransportType
fn transport(&self) -> TransportType
The network transport
Source§fn foundation(&self) -> String
fn foundation(&self) -> String
The (unique) foundation
Source§fn base_address(&self) -> Address
fn base_address(&self) -> Address
The address to send from
Any related address that generated this candidate, e.g. STUN/TURN server
Source§impl PartialEq<Candidate> for CandidateOwned
impl PartialEq<Candidate> for CandidateOwned
Source§impl PartialEq<CandidateOwned> for Candidate
impl PartialEq<CandidateOwned> for Candidate
impl Eq for Candidate
impl Send for Candidate
impl Sync for Candidate
Auto Trait Implementations§
impl Freeze for Candidate
impl RefUnwindSafe for Candidate
impl Unpin for Candidate
impl UnwindSafe for Candidate
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)