Struct fahapi::DEFAULT_ADDR[][src]

pub struct DEFAULT_ADDR { /* fields omitted */ }

Default TCP address of the FAH client.

Methods from Deref<Target = SocketAddr>

pub fn ip(&self) -> IpAddr1.7.0[src]

Returns the IP address associated with this socket address.

Examples

use std::net::{IpAddr, Ipv4Addr, SocketAddr};

let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!(socket.ip(), IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)));

pub fn port(&self) -> u161.0.0[src]

Returns the port number associated with this socket address.

Examples

use std::net::{IpAddr, Ipv4Addr, SocketAddr};

let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!(socket.port(), 8080);

pub fn is_ipv4(&self) -> bool1.16.0[src]

Returns true if the IP address in this SocketAddr is an IPv4 address, and false otherwise.

Examples

use std::net::{IpAddr, Ipv4Addr, SocketAddr};

let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!(socket.is_ipv4(), true);
assert_eq!(socket.is_ipv6(), false);

pub fn is_ipv6(&self) -> bool1.16.0[src]

Returns true if the IP address in this SocketAddr is an IPv6 address, and false otherwise.

Examples

use std::net::{IpAddr, Ipv6Addr, SocketAddr};

let socket = SocketAddr::new(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 65535, 0, 1)), 8080);
assert_eq!(socket.is_ipv4(), false);
assert_eq!(socket.is_ipv6(), true);

Trait Implementations

impl Deref for DEFAULT_ADDR[src]

type Target = SocketAddr

The resulting type after dereferencing.

impl LazyStatic for DEFAULT_ADDR[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.