Enum nix::sys::socket::SockAddr [−][src]
#[non_exhaustive]
pub enum SockAddr {
Inet(InetAddr),
Unix(UnixAddr),
Netlink(NetlinkAddr),
Alg(AlgAddr),
Link(LinkAddr),
Vsock(VsockAddr),
}
Expand description
Represents a socket address
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Inet(InetAddr)
Tuple Fields
0: InetAddr
Unix(UnixAddr)
Tuple Fields
0: UnixAddr
Netlink(NetlinkAddr)
Tuple Fields
0: NetlinkAddr
Alg(AlgAddr)
Tuple Fields
0: AlgAddr
Link(LinkAddr)
Tuple Fields
0: LinkAddr
Datalink address (MAC)
Vsock(VsockAddr)
Tuple Fields
0: VsockAddr
Implementations
👎 Deprecated since 0.23.0:
use .to_string() instead
Conversion from nix’s SockAddr type to the underlying libc sockaddr type.
This is useful for interfacing with other libc functions that don’t yet have nix wrappers. Returns a reference to the underlying data type (as a sockaddr reference) along with the size of the actual data type. sockaddr is commonly used as a proxy for a superclass as C doesn’t support inheritance, so many functions that take a sockaddr * need to take the size of the underlying type as well and then internally cast it back.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SockAddr
impl UnwindSafe for SockAddr
Blanket Implementations
Mutably borrows from an owned value. Read more