pub struct Label(_);
Expand description

Labels are always stored as ASCII, unicode characters must be encoded with punycode

Implementations

These must only be ASCII, with unicode encoded to PunyCode, or other such transformation.

This uses the bytes as raw ascii values, with nothing escaped on the wire. Generally users should use from_str or from_ascii

Translates this string into IDNA safe name, encoding to punycode as necessary.

Takes the ascii string and returns a new label.

This will return an Error if the label is not an ascii string

Returns a new Label of the Wildcard, i.e. “*”

Converts this label to lowercase

Returns true if this label is the wildcard, ‘*’, label

Returns the lenght in bytes of this label

True if the label contains no characters

Returns the raw bytes of the label, this is good for writing to the wire.

See Display for presentation version (unescaped from punycode, etc)

Performs the equivalence operation disregarding case

compares with the other label, ignoring case

Performs the conversion to utf8 from IDNA as necessary, see fmt for more details

Converts this label to safe ascii, escaping characters as necessary

If this is an IDNA, punycode, label, then the xn– prefix will be maintained as ascii

Writes this label to safe ascii, escaping characters as necessary

Trait Implementations

Performs the conversion.

Immutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

outputs characters in a safe string manner.

if the string is punycode, i.e. starts with xn--, otherwise it translates to a safe ascii string escaping characters as necessary.

Feeds this value into the given Hasher. Read more

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

Convert this into Label

Convert this into Label

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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.

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)

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