Struct socket_addr::SocketAddrV4 [] [src]

pub struct SocketAddrV4(pub SocketAddrV4);

Utility struct of SocketAddrV4 for hole punching

Methods from Deref<Target=SocketAddrV4>

fn ip(&self) -> &Ipv4Addr
1.0.0

Returns the IP address associated with this socket address.

fn set_ip(&mut self, new_ip: Ipv4Addr)
1.9.0

Change the IP address associated with this socket address.

fn port(&self) -> u16
1.0.0

Returns the port number associated with this socket address.

fn set_port(&mut self, new_port: u16)
1.9.0

Change the port number associated with this socket address.

Trait Implementations

impl Copy for SocketAddrV4
[src]

impl Clone for SocketAddrV4
[src]

fn clone(&self) -> SocketAddrV4

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 Hash for SocketAddrV4
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl Eq for SocketAddrV4
[src]

impl PartialEq for SocketAddrV4
[src]

fn eq(&self, __arg_0: &SocketAddrV4) -> bool

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

fn ne(&self, __arg_0: &SocketAddrV4) -> bool

This method tests for !=.

impl Debug for SocketAddrV4
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Deref for SocketAddrV4
[src]

type Target = SocketAddrV4

The resulting type after dereferencing

fn deref(&self) -> &SocketAddrV4

The method called to dereference a value

impl Encodable for SocketAddrV4
[src]

fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>

impl Decodable for SocketAddrV4
[src]

fn decode<D: Decoder>(d: &mut D) -> Result<SocketAddrV4, D::Error>