[−][src]Trait addr_hal::SocketAddressV4
Describe the internal data structure behavior of SocketAddrV4
.
You can implement this trait by yourself or use ffi for specific Platform.
Associated Types
type IpAddress: Ipv4Address
Ipv4Address inner type.
Required methods
fn new(ip: Ipv4Addr<Self::IpAddress>, port: u16) -> Self
Creates a new IPv4 address from ip address and port
The result will represent the Socket address ip:port.
fn ip(&self) -> &Ipv4Addr<Self::IpAddress>
Got ip address.
fn set_ip(&mut self, ip: Ipv4Addr<Self::IpAddress>)
Set ip address.
fn port(&self) -> u16
Got port.
fn set_port(&mut self, port: u16)
Set port.