Struct bitflags::__core::net::SocketAddrV4 [] [src]

pub struct SocketAddrV4 {
    // some fields omitted
}
1.0.0

An IPv4 socket address which is a (ip, port) combination.

Methods

impl SocketAddrV4

fn new(ip: Ipv4Addr, port: u16) -> SocketAddrV4

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

fn ip(&self) -> &Ipv4Addr

Returns the IP address associated with this socket address.

fn set_ip(&mut self, new_ip: Ipv4Addr)

Unstable (sockaddr_setters)

: recent addition

Change the IP address associated with this socket address.

fn port(&self) -> u16

Returns the port number associated with this socket address.

fn set_port(&mut self, new_port: u16)

Unstable (sockaddr_setters)

: recent addition

Change the port number associated with this socket address.

Trait Implementations

impl Display for SocketAddrV4

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

impl Debug for SocketAddrV4

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

impl Clone for SocketAddrV4

fn clone(&self) -> SocketAddrV4

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

impl PartialEq<SocketAddrV4> for SocketAddrV4

fn eq(&self, other: &SocketAddrV4) -> bool

fn ne(&self, other: &Rhs) -> bool

impl Eq for SocketAddrV4

impl Hash for SocketAddrV4

fn hash<H>(&self, s: &mut H) where H: Hasher

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

impl ToSocketAddrs for SocketAddrV4

type Iter = IntoIter<SocketAddr>

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

impl FromStr for SocketAddrV41.5.0

type Err = AddrParseError

fn from_str(s: &str) -> Result<SocketAddrV4, AddrParseError>

Derived Implementations

impl Copy for SocketAddrV4