Struct socket_addr::SocketAddrV6 [] [src]

pub struct SocketAddrV6(pub SocketAddrV6);

Utility struct of SocketAddrV6 for hole punching

Methods from Deref<Target = SocketAddrV6>

Returns the IP address associated with this socket address.

Examples

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

let socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 0);
assert_eq!(socket.ip(), &Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));

Returns the port number associated with this socket address.

Examples

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

let socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 0);
assert_eq!(socket.port(), 8080);

Returns the flow information associated with this address.

This information corresponds to the sin6_flowinfo field in C's netinet/in.h, as specified in IETF RFC 2553, Section 3.3. It combines information about the flow label and the traffic class as specified in IETF RFC 2460, respectively Section 6 and Section 7.

Examples

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

let socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 10, 0);
assert_eq!(socket.flowinfo(), 10);

Returns the scope ID associated with this address.

This information corresponds to the sin6_scope_id field in C's netinet/in.h, as specified in IETF RFC 2553, Section 3.3.

Examples

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

let socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 78);
assert_eq!(socket.scope_id(), 78);

Trait Implementations

impl Debug for SocketAddrV6
[src]

Formats the value using the given formatter.

impl PartialEq for SocketAddrV6
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for SocketAddrV6
[src]

impl Hash for SocketAddrV6
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Clone for SocketAddrV6
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for SocketAddrV6
[src]

impl Deref for SocketAddrV6
[src]

The resulting type after dereferencing

The method called to dereference a value

impl Encodable for SocketAddrV6
[src]

Serialize a value using an Encoder.

impl Decodable for SocketAddrV6
[src]

Deserialize a value using a Decoder.