Enum fqdn::Error[][src]

pub enum Error {
    TrailingDotMissing,
    TrailingNulCharMissing,
    InvalidLabelChar,
    InvalidStructure,
    TooLongDomainName,
    TooLongLabel,
    LabelDoesNotStartWithLetter,
    EmptyLabel,
}
Expand description

Error when FQDN parsing goes wrong

Variants

TrailingDotMissing

The trailing dot of the FQDN string is missing.

A valid FQDN string should be ended by a dot (e.g. github.com.).

TrailingNulCharMissing

The trailing nul byte of the FQDN bytes is missing.

A valid FQDN array of bytes should be ended by the nul byte (e.g. b"\x06github\x03com\x00")

InvalidLabelChar

An invalid character is found in a label of the FQDN.

The allowed characters in a FQDN label are letters, digits and '-'. By default, this crate also accepts '_' in FQDN but this behavior could be deactivated with the strict-rfc-1035 feature.

InvalidStructure

The analysed bytes are not consistent with a FQDN sequence of bytes.

Typically, the length bytes of labels are not consistent.

TooLongDomainName

The name of the domain is too long

By default, there is no limit except if the strict-rfc-1035 feature is selected and then, the domain name should be less than 255 characters (including the trailing dot).

TooLongLabel

One label of the FQDN is too long

The returned error contains the excessive length.

By default, the limit is set to 255 characters but if the strict-rfc-1035 feature is selected, then this limit is set to 63 (as said in the RFC).

LabelDoesNotStartWithLetter

One label does not start with a letter

The returned error contains the start position of the involved label

EmptyLabel

One label is empty (e.g. starting dot as .github.com. or two following dots as github..com.)

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

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

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. 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.