9 releases (breaking)
new 0.10.0 | May 15, 2024 |
---|---|
0.9.0 | May 8, 2024 |
0.8.0 | Jan 1, 2024 |
0.7.0 | Dec 17, 2023 |
0.1.1 | Oct 1, 2019 |
#1309 in Network programming
114 downloads per month
Used in web-url
93KB
2.5K
SLoC
address
This library aids in processing network addresses.
Usage
There are currently no features. You can use all address types with the following dependency:
[dependencies]
address = "0.10.0"
Address Types
There are 6 core address types:
- IPAddress: Either an IPv4 address or an IPv6 address.
- Includes
IPAddress
which is an enum, and theIPv4Address
&IPv6Address
struct types.
- Includes
- SocketAddress: An IP address with an associated port.
- Includes the
SocketAddress
,SocketAddressV4
&SocketAddressV6
struct types.
- Includes the
- Domain: A domain name.
- Includes: the
Domain
&DomainRef
types.
- Includes: the
- Endpoint: A domain with an associated port.
- Includes: the
Endpoint
&EndpointRef
types.
- Includes: the
- Host: Either a domain or an IP address.
- Includes: the
Host
&HostRef
types.
- Includes: the
- Authority: A host with an associated port.
- Includes: the
Authority
&AuthorityRef
types.
- Includes: the
Owned & Reference Types
Address types that are not Copy
have owned and Ref
types (example: Domain
& DomainRef
).
This allows both owned types and reference types that do not require allocation. They can be easily
converted between each other. Note: Cow
was not used to simplify the client code.
Standard Library Types
IP addresses and socket addresses are different from the standard library counterparts. They can be
easily converted between each other. There is a difference in IPv6 socket addresses where the
flow_info
and scope_id
are not included as part of the address.