pub struct Candidate {
pub foundation: String,
pub component_id: u32,
pub transport: String,
pub priority: u64,
pub address: CandidateAddress,
pub port: u16,
pub typ: CandidateType,
pub rel_addr: Option<IpAddr>,
pub rel_port: Option<u16>,
pub extensions: Vec<(String, String)>,
}Expand description
ICE Candidate attribute of the media
Fields§
§foundation: StringArbitrary string used in the freezing algorithm to group similar candidates See RFC 8445 Section 5.1.1.3
component_id: u32Identifies the specific component of the data stream 1 for RTP and 2 for RTCP
transport: StringTransport protocol of the candidate
priority: u64Candidate’s priority
address: CandidateAddressIP address of the candidate IPv4, IPv6 addresses and FQDN allowed
port: u16Port of the candidate
typ: CandidateTypeType of the candidate
rel_addr: Option<IpAddr>Address related to the candidate Required for srflx, prflx and relay type candidates
rel_port: Option<u16>Port related to the candidate Required for srflx, prflx and relay type candidates
extensions: Vec<(String, String)>Extensions
Implementations§
Source§impl Candidate
impl Candidate
pub fn new( foundation: impl ToString, component_id: u32, transport: impl ToString, priority: u64, address: CandidateAddress, port: u16, typ: CandidateType, ) -> Self
pub fn with_rel_addr( foundation: impl ToString, component_id: u32, transport: impl ToString, priority: u64, address: CandidateAddress, port: u16, typ: CandidateType, rel_addr: impl Into<IpAddr>, ) -> Self
pub fn with_rel_addr_and_port( foundation: impl ToString, component_id: u32, transport: impl ToString, priority: u64, address: CandidateAddress, port: u16, typ: CandidateType, rel_addr: impl Into<IpAddr>, rel_port: u16, ) -> Self
pub fn set_rel_addr(&mut self, rel_addr: impl Into<IpAddr>)
pub fn set_rel_port(&mut self, rel_port: u16)
pub fn add_extension(&mut self, name: impl ToString, value: impl ToString)
Trait Implementations§
impl Eq for Candidate
impl StructuralPartialEq for Candidate
Auto Trait Implementations§
impl Freeze for Candidate
impl RefUnwindSafe for Candidate
impl Send for Candidate
impl Sync for Candidate
impl Unpin for Candidate
impl UnsafeUnpin for Candidate
impl UnwindSafe for Candidate
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