Stdlibnet
net::addr
Addresses: IP addresses, the address-plus-port pair every socket constructor takes, and a URL parser.
public module net::addr::ip;
public module net::addr::socket_addr;
public module net::addr::sockaddr;
public module net::addr::url;
| File | What it holds | Import |
|---|---|---|
ip | IpV4Addr, IpV6Addr, IpAddr | import std::net::addr::ip; |
socket_addr | SocketAddr | import std::net::addr::socket_addr; |
url | Url, UrlError | import std::net::addr::url; |
net::addr::sockaddr holds pack_sockaddr_in and unpack_sockaddr, the hand-packed struct sockaddr bridge every socket call goes through. It is public for code that needs to speak to a raw socket API, and otherwise not something you call; it has no page.
IPv6 addressing is parsed and represented, and TCP opens an
AF_INET6socket for a v6 address. UDP is IPv4-only for now:bind,connect, andUdpSendToreject anIpAddr::V6up front withUnsupported.