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: ToLabelIter> Chain<L, R>
impl<L: ToRelativeDname, 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 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, R, Target> FlattenInto<Dname<Target>> for Chain<L, R>where
L: ToRelativeDname,
R: ToDname + FlattenInto<Dname<Target>, AppendError = BuilderAppendError<Target>>,
Target: FromBuilder,
<Target as FromBuilder>::Builder: EmptyBuilder,
impl<L, R, Target> FlattenInto<Dname<Target>> for Chain<L, R>where
L: ToRelativeDname,
R: ToDname + FlattenInto<Dname<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<Dname<Target>, Self::AppendError>
source§impl<L: ToRelativeDname, R: ToDname> ToDname for Chain<L, R>
impl<L: ToRelativeDname, R: ToDname> ToDname for Chain<L, R>
source§fn to_dname<Octets>(&self) -> Result<Dname<Octets>, BuilderAppendError<Octets>>
fn to_dname<Octets>(&self) -> Result<Dname<Octets>, BuilderAppendError<Octets>>
source§fn to_canonical_dname<Octets>(
&self,
) -> Result<Dname<Octets>, BuilderAppendError<Octets>>
fn to_canonical_dname<Octets>( &self, ) -> Result<Dname<Octets>, BuilderAppendError<Octets>>
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: ToDname + ?Sized>(&self, other: &N) -> Ordering
fn composed_cmp<N: ToDname + ?Sized>(&self, other: &N) -> Ordering
source§fn lowercase_composed_cmp<N: ToDname + ?Sized>(&self, other: &N) -> Ordering
fn lowercase_composed_cmp<N: ToDname + ?Sized>(&self, other: &N) -> Ordering
source§fn rrsig_label_count(&self) -> u8
fn rrsig_label_count(&self) -> u8
source§impl<Octets, R> ToDname for Chain<UncertainDname<Octets>, R>
impl<Octets, R> ToDname for Chain<UncertainDname<Octets>, R>
source§fn to_dname<Octets>(&self) -> Result<Dname<Octets>, BuilderAppendError<Octets>>
fn to_dname<Octets>(&self) -> Result<Dname<Octets>, BuilderAppendError<Octets>>
source§fn to_canonical_dname<Octets>(
&self,
) -> Result<Dname<Octets>, BuilderAppendError<Octets>>
fn to_canonical_dname<Octets>( &self, ) -> Result<Dname<Octets>, BuilderAppendError<Octets>>
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: ToDname + ?Sized>(&self, other: &N) -> Ordering
fn composed_cmp<N: ToDname + ?Sized>(&self, other: &N) -> Ordering
source§fn lowercase_composed_cmp<N: ToDname + ?Sized>(&self, other: &N) -> Ordering
fn lowercase_composed_cmp<N: ToDname + ?Sized>(&self, other: &N) -> Ordering
source§fn rrsig_label_count(&self) -> u8
fn rrsig_label_count(&self) -> u8
source§impl<L: ToRelativeDname, R: ToLabelIter> ToLabelIter for Chain<L, R>
impl<L: ToRelativeDname, R: ToLabelIter> ToLabelIter for Chain<L, R>
§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<UncertainDname<Octs>, R>
impl<Octs, R> ToLabelIter for Chain<UncertainDname<Octs>, R>
§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: ToRelativeDname, R: ToRelativeDname> ToRelativeDname for Chain<L, R>
impl<L: ToRelativeDname, R: ToRelativeDname> ToRelativeDname for Chain<L, R>
source§fn to_relative_dname<Octets>(
&self,
) -> Result<RelativeDname<Octets>, BuilderAppendError<Octets>>
fn to_relative_dname<Octets>( &self, ) -> Result<RelativeDname<Octets>, BuilderAppendError<Octets>>
source§fn to_canonical_relative_dname<Octets>(
&self,
) -> Result<RelativeDname<Octets>, BuilderAppendError<Octets>>
fn to_canonical_relative_dname<Octets>( &self, ) -> Result<RelativeDname<Octets>, BuilderAppendError<Octets>>
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) -> RelativeDname<Cow<'_, [u8]>>
fn to_cow(&self) -> RelativeDname<Cow<'_, [u8]>>
source§fn to_bytes(&self) -> RelativeDname<Bytes>
fn to_bytes(&self) -> RelativeDname<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, Dname<&'static [u8]>>where
Self: Sized,
fn chain_root(self) -> Chain<Self, Dname<&'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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)