kvarn_utils::prelude::net

Struct SocketAddrV6

1.0.0 · source
pub struct SocketAddrV6 { /* private fields */ }
Expand description

An IPv6 socket address.

IPv6 socket addresses consist of an IPv6 address, a 16-bit port number, as well as fields containing the traffic class, the flow label, and a scope identifier (see IETF RFC 2553, Section 3.3 for more details).

See SocketAddr for a type encompassing both IPv4 and IPv6 socket addresses.

The size of a SocketAddrV6 struct may vary depending on the target operating system. Do not assume that this type has the same memory layout as the underlying system representation.

§Examples

use std::net::{Ipv6Addr, SocketAddrV6};

let socket = SocketAddrV6::new(Ipv6Addr::new(0x2001, 0xdb8, 0,