Struct domain::bits::name::LabelBuf[][src]

pub struct LabelBuf { /* fields omitted */ }

An owned domain name label.

This type is the owned companion of and derefs to Label.

Methods

impl LabelBuf
[src]

Creates an owned label from a label slice.

LabelBuf also implements From<&Label>, so the canonical form of this function is actually label.into().

Returns an owned root label.

Returns a reference to a slice of the label.

Methods from Deref<Target = Label>

Returns the length of the label.

This is equal to the length of the wire representation of the label. For normal labels, it is one more than the length of the content. For binary labels, things are a wee bit more complicated. See the discussion of label encodings with the LabelContent type for more details.

Returns whether the label is empty.

(A well-formed label never is.)

Returns whether this label is the root label.

Returns the label’s content.

Returns a string slice if this is a normal label and purely ASCII.

To get a string representation of any label, you can use the format!() macro as Label implements the Display trait.

Returns a bytes slice with the raw content of this label.

Important traits for LabelIter<'a>

Returns an iterator over the labelettes in this label.

See ['Labelette'] for what labelettes are supposed to be.

Trait Implementations

impl<'a> From<&'a Label> for LabelBuf
[src]

Performs the conversion.

impl Deref for LabelBuf
[src]

The resulting type after dereferencing.

Dereferences the value.

impl Borrow<Label> for LabelBuf
[src]

Immutably borrows from an owned value. Read more

impl AsRef<Label> for LabelBuf
[src]

Performs the conversion.

impl<T: AsRef<Label>> PartialEq<T> for LabelBuf
[src]

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

This method tests for !=.

impl Eq for LabelBuf
[src]

impl Hash for LabelBuf
[src]

Feeds this value into the given [Hasher]. Read more

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

impl Display for LabelBuf
[src]

Formats the value using the given formatter. Read more

impl Octal for LabelBuf
[src]

Formats the value using the given formatter.

impl LowerHex for LabelBuf
[src]

Formats the value using the given formatter.

impl UpperHex for LabelBuf
[src]

Formats the value using the given formatter.

impl Binary for LabelBuf
[src]

Formats the value using the given formatter.

impl Debug for LabelBuf
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for LabelBuf

impl Sync for LabelBuf