Skip to content
CryoCryo home
Stdlibnet

net::address

Addresses: IP addresses, the address-plus-port pair every socket constructor takes, and a URL parser.

module net::address::ip;
module net::address::socket_address;
module net::address::url;
internal module net::address::socket_address_storage;

export std::net::address::ip::{ IpAddress, IpV4Address, IpV6Address };
export std::net::address::socket_address::{ SocketAddress };
export std::net::address::url::{ Url, UrlError };
FileWhat it holdsImport
ipIpV4Address, IpV6Address, IpAddressimport std::net::address::ip;
socket_addressSocketAddressimport std::net::address::socket_address;
urlUrl, UrlErrorimport std::net::address::url;

net::address::socket_address_storage packs a SocketAddress into the C sockaddr storage the socket calls take, and reads one back. It is internal to the standard library and has no page.

IPv6 addressing is parsed and represented, and TCP opens an AF_INET6 socket for a v6 address. UDP is IPv4-only for now: bind, connect, and send_to reject an IpAddress::V6 up front with Unsupported.