pub struct Connection {
pub nettype: NetType,
pub addrtype: AddrType,
pub connection_address: String,
}Expand description
Connection data for the session or media.
See RFC 8866 Section 5.7 for more details.
Fields§
§nettype: NetTypeType of network for this connection.
addrtype: AddrTypeType of the connection_address.
connection_address: StringConnection address.
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn from_ip_addr(connection_address: impl Into<IpAddr>) -> Self
pub fn from_ip_addr(connection_address: impl Into<IpAddr>) -> Self
Construct a Connection with the specified IP connection_address
Sourcepub fn new(
nettype: NetType,
addrtype: AddrType,
connection_address: impl ToString,
) -> Self
pub fn new( nettype: NetType, addrtype: AddrType, connection_address: impl ToString, ) -> Self
Construct a Connection
See also Connection::from_ip_addr
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
Sourcepub fn try_parse_connection_ip_address(&self) -> Result<IpAddr, &str>
pub fn try_parse_connection_ip_address(&self) -> Result<IpAddr, &str>
Tries to parse the connection_address String of self as IpAddr
Returns the Ok with the parsed IpAddr or Err with the string address
if parsing failed.
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Connection
impl Debug for Connection
impl Eq for Connection
Source§impl PartialEq for Connection
impl PartialEq for Connection
impl StructuralPartialEq for Connection
Auto Trait Implementations§
impl Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
impl UnwindSafe for Connection
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