[][src]Struct domain::base::name::OwnedLabel

pub struct OwnedLabel(_);

An owned label.

Since labels are relatively short, this type doesn’t actually allocate any memory but is a 64 octet array.

Implementations

impl OwnedLabel[src]

pub fn from_label(label: &Label) -> Self[src]

Creates a new owned label from an existing label.

pub fn make_canonical(&mut self)[src]

Converts the label into the canonical form.

This form has all octets representing ASCII letters converted to their lower case form.

pub fn as_label(&self) -> &Label[src]

Returns a reference to the label.

pub fn as_label_mut(&mut self) -> &mut Label[src]

Returns a mutable reference to the label.

pub fn as_wire_slice(&self) -> &[u8][src]

Returns a slice that is the wire-representation of the label.

Methods from Deref<Target = Label>

pub fn as_slice(&self) -> &[u8][src]

Returns a reference to the underlying octets slice.

pub fn as_slice_mut(&mut self) -> &mut [u8][src]

Returns a mutable reference to the underlying octets slice.

pub fn to_canonical(&self) -> OwnedLabel[src]

Returns the label in canonical form.

In this form, all ASCII letters are lowercase.

pub fn composed_cmp(&self, other: &Self) -> Ordering[src]

Returns the composed label ordering.

pub fn lowercase_composed_cmp(&self, other: &Self) -> Ordering[src]

Returns the composed ordering with ASCII letters lowercased.

pub fn build<Builder: OctetsBuilder>(
    &self,
    target: &mut Builder
) -> Result<(), ShortBuf>
[src]

Appends the label to an octets builder.

The method builds the encoded form of the label that starts with a one octet length indicator.

pub fn build_lowercase<Builder: OctetsBuilder>(
    &self,
    target: &mut Builder
) -> Result<(), ShortBuf>
[src]

Appends the lowercased label to an octets builder.

The method builds the encoded form of the label that starts with a one octet length indicator. It also converts all ASCII letters into their lowercase form.

pub fn is_root(&self) -> bool[src]

Returns whether the label is the root label.

pub fn is_wildcard(&self) -> bool[src]

Returns whether the label is the wildcard label.

pub fn compose_len(&self) -> usize[src]

Returns the length of the composed version of the label.

This length is one more than the length of the label as their is a leading length octet.

Trait Implementations

impl AsMut<[u8]> for OwnedLabel[src]

impl AsMut<Label> for OwnedLabel[src]

impl AsRef<[u8]> for OwnedLabel[src]

impl AsRef<Label> for OwnedLabel[src]

impl Borrow<Label> for OwnedLabel[src]

impl BorrowMut<Label> for OwnedLabel[src]

impl Deref for OwnedLabel[src]

type Target = Label

The resulting type after dereferencing.

impl DerefMut for OwnedLabel[src]

impl Eq for OwnedLabel[src]

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

impl Hash for OwnedLabel[src]

impl Ord for OwnedLabel[src]

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

impl<T: AsRef<Label>> PartialOrd<T> for OwnedLabel[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,