Struct std::net::SocketAddr
Re-export from std::net::address::SocketAddr
Socket address (e.g. IP address and port)
Fields
-
kind: AddrKind
-
inner: SocketAddrInner
Methods
impl SocketAddr { ... }
-
fn new(addr: IpAddr, port: u16) -> SocketAddr
Create SocketAddr from IP address and port
-
fn with_flowinfo_and_scope(addr: Ipv6Addr, port: u16, flowinfo: u32, scope_id: u32) -> SocketAddr
Create SocketAddr from IPv6 address, port, flow info and scope ID.
-
fn set_port(self: &mut SocketAddr, port: u16)
Sets the port number
-
fn port(self: &SocketAddr) -> u16
Returns the port number
-
fn ip(self: &SocketAddr) -> IpAddr
Returns the IP address
-
fn parse(s: &[u8]) -> Option<SocketAddr>
Parses a socket address from a string.
-
fn fmt<F>(self: &SocketAddr, f: &mut F) -> Result
F: Formatter<F> -
fn equals(self: &SocketAddr, other: &SocketAddr) -> bool
-
fn hash<H>(self: &SocketAddr, hasher: &mut H)
H: Hasher<H>
Mixins
impl SocketAddr { ... }
-
mixin Equatable<SocketAddr>
-
Returns
false
if arguments are equal,true
otherwise