#[non_exhaustive]
pub enum Error {
    NotEnoughWriteSpace {
        tried_to_write: NonZeroUsize,
        available: usize,
        buffer_type: &'static str,
    },
    NotEnoughReadBytes {
        tried_to_read: NonZeroUsize,
        available: usize,
    },
    Parse {
        name: &'static str,
    },
    NameTooLong(usize),
    InvalidUtf8(Utf8Error),
    InvalidCode(InvalidCode),
    TooManyUrlSegments(usize),
}
Expand description

An error that may occur while using the DNS protocol.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

NotEnoughWriteSpace

Fields

tried_to_write: NonZeroUsize

The number of entries we tried to write.

available: usize

The number of entries that were available in the buffer.

buffer_type: &'static str

The type of the buffer that we tried to write to.

We are trying to write to a buffer, but the buffer doesn’t have enough space.

This error can be fixed by increasing the size of the buffer.

NotEnoughReadBytes

Fields

tried_to_read: NonZeroUsize

The number of bytes we tried to read.

available: usize

The number of bytes that were available in the buffer.

We attempted to read from a buffer, but we ran out of room before we could read the entire value.

This error can be fixed by reading more bytes.

Parse

Fields

name: &'static str

The name of the value we tried to parse.

We tried to parse this value, but it was invalid.

NameTooLong(usize)

We tried to serialize a string longer than 256 bytes.

InvalidUtf8(Utf8Error)

We could not create a valid UTF-8 string from the bytes we read.

InvalidCode(InvalidCode)

We could not convert a raw number to a code.

TooManyUrlSegments(usize)

We do not support this many URL segments.

Trait Implementations

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0:

use the Display impl or to_string()

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.