pub struct Chain<L, R> { /* private fields */ }Expand description
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.
Implementations§
Source§impl<L: ToRelativeDname, R: Compose> Chain<L, R>
impl<L: ToRelativeDname, R: Compose> Chain<L, R>
Sourcepub fn chain<N: Compose>(
self,
other: N,
) -> Result<Chain<Self, N>, LongChainError>
pub fn chain<N: Compose>( 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.
Trait Implementations§
Source§impl<L: ToRelativeDname, R: ToDname> ToDname for Chain<L, R>
impl<L: ToRelativeDname, R: ToDname> ToDname for Chain<L, R>
Source§impl<R: ToDname> ToDname for Chain<UncertainDname, R>
impl<R: ToDname> ToDname for Chain<UncertainDname, R>
Source§impl<'a, L: ToRelativeDname, R: for<'r> ToLabelIter<'r>> ToLabelIter<'a> for Chain<L, R>
impl<'a, L: ToRelativeDname, R: for<'r> ToLabelIter<'r>> ToLabelIter<'a> for Chain<L, R>
Source§fn iter_labels(&'a self) -> Self::LabelIter
fn iter_labels(&'a self) -> Self::LabelIter
Source§fn starts_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool
fn starts_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool
base is a prefix of self.Source§impl<'a, R: ToDname> ToLabelIter<'a> for Chain<UncertainDname, R>
impl<'a, R: ToDname> ToLabelIter<'a> for Chain<UncertainDname, R>
Source§type LabelIter = UncertainChainIter<'a, R>
type LabelIter = UncertainChainIter<'a, R>
Source§fn iter_labels(&'a self) -> Self::LabelIter
fn iter_labels(&'a self) -> Self::LabelIter
Source§fn starts_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool
fn starts_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool
base is a prefix of self.