Struct std::net::SocketAddrUnstable [-] [+] [src]

pub struct SocketAddr {
    // some fields omitted
}

Representation of a socket address for networking applications

A socket address consists of at least an (ip, port) pair and may also contain other information depending on the protocol.

Methods

impl SocketAddr

fn new(ip: IpAddr, port: u16) -> SocketAddr

Creates a new socket address from the (ip, port) pair.

fn ip(&self) -> IpAddr

Gets the IP address associated with this socket address.

fn port(&self) -> u16

Gets the port number associated with this socket address

Trait Implementations

impl Display for SocketAddr

fn fmt(&self, f: &mut Formatter) -> Result

impl Debug for SocketAddr

fn fmt(&self, fmt: &mut Formatter) -> Result

impl ToSocketAddrs for SocketAddr

type Iter = IntoIter<SocketAddr>

fn to_socket_addrs(&self) -> Result<IntoIter<SocketAddr>>

impl FromStr for SocketAddr

type Err = ParseError

fn from_str(s: &str) -> Result<SocketAddr, ParseError>

Derived Implementations

impl Hash for SocketAddr

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl Eq for SocketAddr

impl PartialEq for SocketAddr

fn eq(&self, __arg_0: &SocketAddr) -> bool

fn ne(&self, __arg_0: &SocketAddr) -> bool

impl Clone for SocketAddr

fn clone(&self) -> SocketAddr

fn clone_from(&mut self, source: &Self)

impl Copy for SocketAddr