[][src]Struct domain_core::bits::name::Chain

pub struct Chain<L, R> { /* fields omitted */ }

Two domain names chained together.

This type is the result of calling the chain method on RelativeDname, UncertainDname, or on Chain itself.

The chain can be both an absolute or relative domain name—and implements the respective traits ToDname or ToRelativeDname—, depending on whether the second name is absolute or relative.

A chain on an uncertain name is special in that the second name is only used if the uncertain name is relative.

Methods

impl<L: ToRelativeDname, R: Compose> Chain<L, R>[src]

pub fn chain<N: Compose>(
    self,
    other: N
) -> Result<Chain<Self, N>, LongChainError>
[src]

Extends the chain with another domain name.

While the method accepts anything Compose as the second element of the chain, the resulting Chain will only implement ToDname or ToRelativeDname if if also implements ToDname or ToRelativeDname, respectively.

The method will fail with an error if the chained name is longer than 255 bytes.

impl<L, R> Chain<L, R>[src]

pub fn unwrap(self) -> (L, R)[src]

Unwraps the chain into its two constituent components.

Trait Implementations

impl<L: ToRelativeDname, R: Compose> Compose for Chain<L, R>[src]

impl<R: ToDname> Compose for Chain<UncertainDname, R>[src]

impl<L: ToRelativeDname, R: ToDname> Compress for Chain<L, R>[src]

impl<R: ToDname> Compress for Chain<UncertainDname, R>[src]

impl<'a, L: ToRelativeDname, R: for<'r> ToLabelIter<'r>> ToLabelIter<'a> for Chain<L, R>[src]

type LabelIter = ChainIter<'a, L, R>

The type of the iterator over the labels. Read more

fn starts_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool[src]

Determines whether base is a prefix of self.

fn ends_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool[src]

Determines whether base is a suffix of self.

impl<'a, R: ToDname> ToLabelIter<'a> for Chain<UncertainDname, R>[src]

type LabelIter = UncertainChainIter<'a, R>

The type of the iterator over the labels. Read more

fn starts_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool[src]

Determines whether base is a prefix of self.

fn ends_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool[src]

Determines whether base is a suffix of self.

impl<L: ToRelativeDname, R: ToDname> ToDname for Chain<L, R>[src]

fn to_name(&self) -> Dname[src]

Creates an uncompressed value of the domain name. Read more

fn as_flat_slice(&self) -> Option<&[u8]>[src]

Returns a byte slice of the content if possible. Read more

fn name_eq<N: ToDname>(&self, other: &N) -> bool[src]

Tests whether self and other are equal. Read more

fn name_cmp<N: ToDname>(&self, other: &N) -> Ordering[src]

Returns the ordering between self and other. Read more

impl<R: ToDname> ToDname for Chain<UncertainDname, R>[src]

fn to_name(&self) -> Dname[src]

Creates an uncompressed value of the domain name. Read more

fn as_flat_slice(&self) -> Option<&[u8]>[src]

Returns a byte slice of the content if possible. Read more

fn name_eq<N: ToDname>(&self, other: &N) -> bool[src]

Tests whether self and other are equal. Read more

fn name_cmp<N: ToDname>(&self, other: &N) -> Ordering[src]

Returns the ordering between self and other. Read more

impl<L: ToRelativeDname, R: ToRelativeDname> ToRelativeDname for Chain<L, R>[src]

fn to_name(&self) -> RelativeDname[src]

Creates an uncompressed value of the domain name. Read more

fn as_flat_slice(&self) -> Option<&[u8]>[src]

Returns a byte slice of the content if possible. Read more

fn chain<N: Compose>(self, suffix: N) -> Result<Chain<Self, N>, LongChainError> where
    Self: Sized
[src]

Returns a chain of this name and the provided absolute name.

fn chain_root(self) -> Chain<Self, Dname> where
    Self: Sized
[src]

Returns the absolute name by chaining it with the root label.

fn name_eq<N: ToRelativeDname>(&self, other: &N) -> bool[src]

Tests whether self and other are equal. Read more

fn name_cmp<N: ToRelativeDname>(&self, other: &N) -> Ordering[src]

Returns the ordering between self and other. Read more

impl<L: Clone, R: Clone> Clone for Chain<L, R>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<L: Debug, R: Debug> Debug for Chain<L, R>[src]

impl<L: Display, R: Display> Display for Chain<L, R>[src]

Auto Trait Implementations

impl<L, R> Send for Chain<L, R> where
    L: Send,
    R: Send

impl<L, R> Sync for Chain<L, R> where
    L: Sync,
    R: Sync

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

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

type Error = !

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

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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

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