pub enum LookupErrorKind {
    Again,
    Badflags,
    NoName,
    NoData,
    Fail,
    Family,
    Socktype,
    Service,
    Memory,
    System,
    Unknown,
    IO,
}
Expand description

Different kinds of lookup errors that getaddrinfo and getnameinfo can return. These can be a little inconsitant between platforms, so it’s recommended not to rely on them.

Variants§

§

Again

Temporary failure in name resolution.

May also be returend when DNS server returns a SERVFAIL.

§

Badflags

Invalid value for `ai_flags’ field.

§

NoName

NAME or SERVICE is unknown.

May also be returned when domain doesn’t exist (NXDOMAIN) or domain exists but contains no address records (NODATA).

§

NoData

The specified network host exists, but has no data defined.

This is no longer a POSIX standard, however it’s still returned by some platforms. Be warned that FreeBSD does not include the corresponding EAI_NODATA symbol.

§

Fail

Non-recoverable failure in name resolution.

§

Family

`ai_family’ not supported.

§

Socktype

`ai_socktype’ not supported.

§

Service

SERVICE not supported for `ai_socktype’.

§

Memory

Memory allocation failure.

§

System

System error returned in `errno’.

§

Unknown

An unknown result code was returned.

For some platforms, you may wish to match on an unknown value directly. Note that gai_strerr is used to get error messages, so the generated IO error should contain the correct error message for the platform.

§

IO

A generic C error or IO error occured.

You should convert this LookupError into an IO error directly. Note that the error code is set to 0 in the case this is returned.

Implementations§

source§

impl LookupErrorKind

source

pub fn new(err: i32) -> Self

Create a LookupErrorKind from a gai error.

Trait Implementations§

source§

impl Clone for LookupErrorKind

source§

fn clone(&self) -> LookupErrorKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LookupErrorKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for LookupErrorKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.