pub struct Chain<L, R> { /* private fields */ }
Expand description
Two domain names chained together.
This type is the result of calling RelativeName::chain
,
UncertainName::chain
, or Chain::chain
.
The chain can be both an absolute or relative domain name—and implements
the respective traits ToName
or ToRelativeName
—, 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: ToRelativeName, R: ToLabelIter> Chain<L, R>
impl<L: ToRelativeName, R: ToLabelIter> Chain<L, R>
sourcepub fn chain<N: ToLabelIter>(
self,
other: N,
) -> Result<Chain<Self, N>, LongChainError>
pub fn chain<N: ToLabelIter>( 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 ToName
or
ToRelativeName
if if also implements ToName
or
ToRelativeName
, respectively.
The method will fail with an error if the chained name is longer than 255 bytes.
source§impl<L, R> Chain<L, R>where
Self: ToLabelIter,
impl<L, R> Chain<L, R>where
Self: ToLabelIter,
sourcepub fn fmt_with_dot(&self) -> impl Display + '_
pub fn fmt_with_dot(&self) -> impl Display + '_
Returns an object that displays an absolute name with a final dot.
The chain itself displays without a final dot unless the chain results in an absolute name with the root label only. This method can be used to display a chain that results in an absolute name with a single dot at its end.
Trait Implementations§
source§impl<L, R> Display for Chain<L, R>where
Self: ToLabelIter,
impl<L, R> Display for Chain<L, R>where
Self: ToLabelIter,
source§impl<L, R, Target> FlattenInto<Name<Target>> for Chain<L, R>where
L: ToRelativeName,
R: ToName + FlattenInto<Name<Target>, AppendError = BuilderAppendError<Target>>,
Target: FromBuilder,
<Target as FromBuilder>::Builder: EmptyBuilder,
impl<L, R, Target> FlattenInto<Name<Target>> for Chain<L, R>where
L: ToRelativeName,
R: ToName + FlattenInto<Name<Target>, AppendError = BuilderAppendError<Target>>,
Target: FromBuilder,
<Target as FromBuilder>::Builder: EmptyBuilder,
type AppendError = <<Target as FromBuilder>::Builder as OctetsBuilder>::AppendError
fn try_flatten_into(self) -> Result<Name<Target>, Self::AppendError>
source§impl<L: ToRelativeName, R: ToLabelIter> ToLabelIter for Chain<L, R>
impl<L: ToRelativeName, R: ToLabelIter> ToLabelIter for Chain<L, R>
source§type LabelIter<'a> = ChainIter<'a, L, R>
where
L: 'a,
R: 'a
type LabelIter<'a> = ChainIter<'a, L, R> where L: 'a, R: 'a
source§fn iter_labels(&self) -> Self::LabelIter<'_>
fn iter_labels(&self) -> Self::LabelIter<'_>
source§fn compose_len(&self) -> u16
fn compose_len(&self) -> u16
source§fn starts_with<N: ToLabelIter + ?Sized>(&self, base: &N) -> bool
fn starts_with<N: ToLabelIter + ?Sized>(&self, base: &N) -> bool
base
is a prefix of self
.source§impl<Octs, R> ToLabelIter for Chain<UncertainName<Octs>, R>
impl<Octs, R> ToLabelIter for Chain<UncertainName<Octs>, R>
source§type LabelIter<'a> = UncertainChainIter<'a, Octs, R>
where
Octs: 'a,
R: 'a
type LabelIter<'a> = UncertainChainIter<'a, Octs, R> where Octs: 'a, R: 'a
source§fn iter_labels(&self) -> Self::LabelIter<'_>
fn iter_labels(&self) -> Self::LabelIter<'_>
source§fn compose_len(&self) -> u16
fn compose_len(&self) -> u16
source§fn starts_with<N: ToLabelIter + ?Sized>(&self, base: &N) -> bool
fn starts_with<N: ToLabelIter + ?Sized>(&self, base: &N) -> bool
base
is a prefix of self
.source§impl<L: ToRelativeName, R: ToName> ToName for Chain<L, R>
impl<L: ToRelativeName, R: ToName> ToName for Chain<L, R>
source§fn try_to_name<Octets>(
&self,
) -> Result<Name<Octets>, BuilderAppendError<Octets>>
fn try_to_name<Octets>( &self, ) -> Result<Name<Octets>, BuilderAppendError<Octets>>
source§fn to_name<Octets>(&self) -> Name<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
fn to_name<Octets>(&self) -> Name<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
source§fn try_to_canonical_name<Octets>(
&self,
) -> Result<Name<Octets>, BuilderAppendError<Octets>>
fn try_to_canonical_name<Octets>( &self, ) -> Result<Name<Octets>, BuilderAppendError<Octets>>
source§fn to_canonical_name<Octets>(&self) -> Name<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
fn to_canonical_name<Octets>(&self) -> Name<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
source§fn as_flat_slice(&self) -> Option<&[u8]>
fn as_flat_slice(&self) -> Option<&[u8]>
fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
fn compose_canonical<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
source§fn composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering
fn composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering
source§fn lowercase_composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering
fn lowercase_composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering
source§fn rrsig_label_count(&self) -> u8
fn rrsig_label_count(&self) -> u8
source§impl<Octets, R> ToName for Chain<UncertainName<Octets>, R>
impl<Octets, R> ToName for Chain<UncertainName<Octets>, R>
source§fn try_to_name<Octets>(
&self,
) -> Result<Name<Octets>, BuilderAppendError<Octets>>
fn try_to_name<Octets>( &self, ) -> Result<Name<Octets>, BuilderAppendError<Octets>>
source§fn to_name<Octets>(&self) -> Name<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
fn to_name<Octets>(&self) -> Name<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
source§fn try_to_canonical_name<Octets>(
&self,
) -> Result<Name<Octets>, BuilderAppendError<Octets>>
fn try_to_canonical_name<Octets>( &self, ) -> Result<Name<Octets>, BuilderAppendError<Octets>>
source§fn to_canonical_name<Octets>(&self) -> Name<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
fn to_canonical_name<Octets>(&self) -> Name<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
source§fn as_flat_slice(&self) -> Option<&[u8]>
fn as_flat_slice(&self) -> Option<&[u8]>
fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
fn compose_canonical<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
source§fn composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering
fn composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering
source§fn lowercase_composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering
fn lowercase_composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering
source§fn rrsig_label_count(&self) -> u8
fn rrsig_label_count(&self) -> u8
source§impl<L: ToRelativeName, R: ToRelativeName> ToRelativeName for Chain<L, R>
impl<L: ToRelativeName, R: ToRelativeName> ToRelativeName for Chain<L, R>
source§fn try_to_relative_name<Octets>(
&self,
) -> Result<RelativeName<Octets>, BuilderAppendError<Octets>>
fn try_to_relative_name<Octets>( &self, ) -> Result<RelativeName<Octets>, BuilderAppendError<Octets>>
source§fn to_relative_name<Octets>(&self) -> RelativeName<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
fn to_relative_name<Octets>(&self) -> RelativeName<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
source§fn try_to_canonical_relative_name<Octets>(
&self,
) -> Result<RelativeName<Octets>, BuilderAppendError<Octets>>
fn try_to_canonical_relative_name<Octets>( &self, ) -> Result<RelativeName<Octets>, BuilderAppendError<Octets>>
source§fn to_canonical_relative_name<Octets>(&self) -> RelativeName<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
fn to_canonical_relative_name<Octets>(&self) -> RelativeName<Octets>where
Octets: FromBuilder,
<Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,
source§fn as_flat_slice(&self) -> Option<&[u8]>
fn as_flat_slice(&self) -> Option<&[u8]>
fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
fn compose_canonical<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
source§fn to_cow(&self) -> RelativeName<Cow<'_, [u8]>>
fn to_cow(&self) -> RelativeName<Cow<'_, [u8]>>
source§fn to_bytes(&self) -> RelativeName<Bytes>
fn to_bytes(&self) -> RelativeName<Bytes>
source§fn chain<N: ToLabelIter>(
self,
suffix: N,
) -> Result<Chain<Self, N>, LongChainError>where
Self: Sized,
fn chain<N: ToLabelIter>(
self,
suffix: N,
) -> Result<Chain<Self, N>, LongChainError>where
Self: Sized,
source§fn chain_root(self) -> Chain<Self, Name<&'static [u8]>>where
Self: Sized,
fn chain_root(self) -> Chain<Self, Name<&'static [u8]>>where
Self: Sized,
Auto Trait Implementations§
impl<L, R> Freeze for Chain<L, R>
impl<L, R> RefUnwindSafe for Chain<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Chain<L, R>
impl<L, R> Sync for Chain<L, R>
impl<L, R> Unpin for Chain<L, R>
impl<L, R> UnwindSafe for Chain<L, R>where
L: UnwindSafe,
R: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)