Struct socket_addr::SocketAddrV6
[−]
[src]
pub struct SocketAddrV6(pub SocketAddrV6);
Utility struct of SocketAddrV6 for hole punching
Methods from Deref<Target = SocketAddrV6>
fn ip(&self) -> &Ipv6Addr
1.0.0
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));
fn port(&self) -> u16
1.0.0
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);
fn flowinfo(&self) -> u32
1.0.0
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);
fn scope_id(&self) -> u32
1.0.0
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]
impl PartialEq for SocketAddrV6
[src]
fn eq(&self, __arg_0: &SocketAddrV6) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SocketAddrV6) -> bool
This method tests for !=
.
impl Eq for SocketAddrV6
[src]
impl Hash for SocketAddrV6
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for SocketAddrV6
[src]
fn clone(&self) -> SocketAddrV6
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for SocketAddrV6
[src]
impl Deref for SocketAddrV6
[src]
type Target = SocketAddrV6
The resulting type after dereferencing
fn deref(&self) -> &SocketAddrV6
The method called to dereference a value
impl Encodable for SocketAddrV6
[src]
impl Decodable for SocketAddrV6
[src]
fn decode<D: Decoder>(d: &mut D) -> Result<SocketAddrV6, D::Error>
Deserialize a value using a Decoder
.