uaddr
This crate provides a unified address type that can represent:
- an IPv4 / IPv6 socket address;
- a UNIX domain socket (UDS) address;
- a hostname with a port.
Migration from uni-addr
uni-addr was renamed to uaddr since version 0.4.0. The key changes between 0.3.x and 0.4.0 are as follows.
-
Added: type
UnixAddrrepresenting a UNIX domain socket address.See below for the motivation.
-
Breaking change: type
SocketAddrfor UNIX platform is now removed.Type
SocketAddrfor UNIX platform was a wrapper overSocketAddrprovided by the standard library, which is quite bloated (~128 bytes), and there're also limitations in terms of the APIs. We then replace it withUnixAddrwhich can be converted toSocketAddrlazily if needed. -
Added: type
HostAddrrepresenting a hostname with a port (hostname:port) was introduced.See below for the motivation.
-
Breaking change: type
UniAddrInneris now removed.Before 0.4.0, the
Hostvariant of the address type enum contained anArc<str>to store the validated "hostname:port". To prevent callers from bypassing validation and directly constructing theHostvariant, the enum type was namedUniAddrInnerand wrapped withUniAddr. After 0.4.0, we fixed this flawed design. -
Added:
no_stdsupport.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.