pub struct Rtcp {
pub port: u16,
pub nettype: Option<NetType>,
pub addrtype: Option<AddrType>,
pub connection_address: Option<String>,
}Expand description
RTCP port number and address
To be used if not algorithmically derived from the RTP port described in the media line
The address part is optional: when absent, RTCP is sent to the connection address given for the media.
Fields§
§port: u16Port used for the RTCP stream
nettype: Option<NetType>Network Type
None if the address part is absent
addrtype: Option<AddrType>Address type
None if the address part is absent
connection_address: Option<String>Connection address: can be IP Address, unicast, multicast, …
Conformity may be checked against the addrtype.
None if the address part is absent
Implementations§
Source§impl Rtcp
impl Rtcp
Sourcepub fn with_port(port: u16) -> Self
pub fn with_port(port: u16) -> Self
Construct an Rtcp with only a port number, i.e. without an address
part.
RTCP is then sent to the connection address given for the media.
Sourcepub fn with_ip_addr(port: u16, connection_address: impl Into<IpAddr>) -> Self
pub fn with_ip_addr(port: u16, connection_address: impl Into<IpAddr>) -> Self
Construct an Rtcp with the specified IP connection_address
Sourcepub fn new(
port: u16,
nettype: NetType,
addrtype: AddrType,
connection_address: impl ToString,
) -> Self
pub fn new( port: u16, nettype: NetType, addrtype: AddrType, connection_address: impl ToString, ) -> Self
Construct an Rtcp
See also Rtcp::with_ip_addr and Rtcp::with_port
Sourcepub fn try_parse_connection_ip_address(&self) -> Option<Result<IpAddr, &str>>
pub fn try_parse_connection_ip_address(&self) -> Option<Result<IpAddr, &str>>
Tries to parse the connection_address String of self as IpAddr
Returns None if the address part is absent, the Ok with the parsed
IpAddr or Err with the string address if parsing failed.
Sourcepub fn set_connection_ip_address(
&mut self,
connection_address: impl Into<IpAddr>,
)
pub fn set_connection_ip_address( &mut self, connection_address: impl Into<IpAddr>, )
Sets the connection_address & addrtype of self from the specified IpAddr
Also sets the nettype to IN if it is not set yet.