[−][src]Struct domain_core::bits::name::Chain
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]
self,
other: N
) -> Result<Chain<Self, N>, LongChainError>
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]
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 iter_labels(&'a self) -> Self::LabelIter
[src]
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 iter_labels(&'a self) -> Self::LabelIter
[src]
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]
Self: Sized,
Returns a chain of this name and the provided absolute name.
fn chain_root(self) -> Chain<Self, Dname> where
Self: Sized,
[src]
Self: Sized,
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(&self) -> 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,
L: Send,
R: Send,
impl<L, R> Sync for Chain<L, R> where
L: Sync,
R: Sync,
L: Sync,
R: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,