doc.rust-lang.org
pub const fn set_ip(&mut self, new_ip: Ipv6Addr)
Changes the IP address associated with this socket address.
method
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn set_flowinfo(&mut self, new_flowinfo: u32)
Changes the flow information associated with this socket address.
method
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn scope_id(&self) -> u32
Returns the scope ID associated with this address.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn port(&self) -> u16
Returns the port number associated with this socket address.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new(ip: Ipv6Addr, port: u16, flowinfo: u32, scope_id: u32) -> SocketAddrV6
Creates a new socket address from an IPv6 address, a 16-bit port number, and the flowinfo and scope_id fields.
associated_function
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn ip(&self) -> &Ipv6Addr
Returns the IP address associated with this socket address.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn flowinfo(&self) -> u32
Returns the flow information associated with this address.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct SocketAddrV6
An IPv6 socket address.
struct
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn set_port(&mut self, new_port: u16)
Changes the port number associated with this socket address.
method
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn set_ip(&mut self, new_ip: Ipv4Addr)
Changes the IP address associated with this socket address.
method
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn port(&self) -> u16
Returns the port number associated with this socket address.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new(ip: Ipv4Addr, port: u16) -> SocketAddrV4
Creates a new socket address from an IPv4 address and a port number.
associated_function
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn ip(&self) -> &Ipv4Addr
Returns the IP address associated with this socket address.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct SocketAddrV4
An IPv4 socket address.
struct
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn set_port(&mut self, new_port: u16)
Changes the port number associated with this socket address.
method
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn set_ip(&mut self, new_ip: IpAddr)
Changes the IP address associated with this socket address.
method
core
Stable since 1.9.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn port(&self) -> u16
Returns the port number associated with this socket address.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new(ip: IpAddr, port: u16) -> SocketAddr
Creates a new socket address from an IP address and a port number.
associated_function
core
Stable since 1.7.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_ipv6(&self) -> bool
Returns true if the IP address in this SocketAddr is an IPv6 address, and false otherwise.
method
core
Stable since 1.16.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_ipv4(&self) -> bool
Returns true if the IP address in this SocketAddr is an IPv4 address, and false otherwise.
method
core
Stable since 1.16.0
Version 1.100.0-nightly