[]Struct gio::InetAddress

pub struct InetAddress(_, _);

InetAddress represents an IPv4 or IPv6 internet address. Use ResolverExt::lookup_by_name or ResolverExt::lookup_by_name_async to look up the InetAddress for a hostname. Use ResolverExt::lookup_by_address or ResolverExt::lookup_by_address_async to look up the hostname for a InetAddress.

To actually connect to a remote host, you will need a InetSocketAddress (which includes a InetAddress as well as a port number).

Implements

InetAddressExt, glib::object::ObjectExt

Methods

impl InetAddress[src]

pub fn new_from_bytes(inet_address_bytes: InetAddressBytes) -> Self[src]

Creates a new InetAddress from the given family and bytes. bytes should be 4 bytes for SocketFamily::Ipv4 and 16 bytes for SocketFamily::Ipv6.

bytes

raw address data

family

the address family of bytes

Returns

a new InetAddress corresponding to family and bytes. Free the returned object with gobject::ObjectExt::unref.

impl InetAddress[src]

pub fn new_any(family: SocketFamily) -> InetAddress[src]

Creates a InetAddress for the "any" address (unassigned/"don't care") for family.

family

the address family

Returns

a new InetAddress corresponding to the "any" address for family. Free the returned object with gobject::ObjectExt::unref.

pub fn new_from_string(string: &str) -> InetAddress[src]

Parses string as an IP address and creates a new InetAddress.

string

a string representation of an IP address

Returns

a new InetAddress corresponding to string, or None if string could not be parsed. Free the returned object with gobject::ObjectExt::unref.

pub fn new_loopback(family: SocketFamily) -> InetAddress[src]

Creates a InetAddress for the loopback address for family.

family

the address family

Returns

a new InetAddress corresponding to the loopback address for family. Free the returned object with gobject::ObjectExt::unref.

Trait Implementations

impl Clone for InetAddress

impl Debug for InetAddress

impl Display for InetAddress[src]

impl Eq for InetAddress

impl Hash for InetAddress

impl Ord for InetAddress

impl<T: ObjectType> PartialEq<T> for InetAddress

impl<T: ObjectType> PartialOrd<T> for InetAddress

impl Send for InetAddress[src]

impl StaticType for InetAddress

impl Sync for InetAddress[src]

Auto Trait Implementations

impl RefUnwindSafe for InetAddress

impl Unpin for InetAddress

impl UnwindSafe for InetAddress

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<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 
[src]

impl<T> Cast for T where
    T: ObjectType
[src]

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

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

impl<T> ObjectExt for T where
    T: ObjectType
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized
[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.