domain::base::name

Struct Chain

source
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, R> Chain<L, R>

source

pub fn scan<S: Scanner<Name = Self>>(scanner: &mut S) -> Result<Self, S::Error>

source§

impl<L: ToRelativeName, R: ToLabelIter> Chain<L, R>

source

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,

source

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.

source§

impl<L, R> Chain<L, R>

source

pub fn unwrap(self) -> (L, R)

Unwraps the chain into its two constituent components.

Trait Implementations§

source§

impl<L: Clone, R: Clone> Clone for Chain<L, R>

source§

fn clone(&self) -> Chain<L, R>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<L: Debug, R: Debug> Debug for Chain<L, R>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<L, R> Display for Chain<L, R>
where Self: ToLabelIter,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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,

source§

impl<L: ToRelativeName, R: ToLabelIter> ToLabelIter for Chain<L, R>

source§

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

The type of the iterator over the labels. Read more
source§

fn iter_labels(&self) -> Self::LabelIter<'_>

Returns an iterator over the labels.
source§

fn compose_len(&self) -> u16

Returns the length in octets of the encoded name.
source§

fn starts_with<N: ToLabelIter + ?Sized>(&self, base: &N) -> bool

Determines whether base is a prefix of self.
source§

fn ends_with<N: ToLabelIter + ?Sized>(&self, base: &N) -> bool

Determines whether base is a suffix of self.
source§

impl<Octs, R> ToLabelIter for Chain<UncertainName<Octs>, R>
where Octs: AsRef<[u8]>, R: ToName,

source§

type LabelIter<'a> = UncertainChainIter<'a, Octs, R> where Octs: 'a, R: 'a

The type of the iterator over the labels. Read more
source§

fn iter_labels(&self) -> Self::LabelIter<'_>

Returns an iterator over the labels.
source§

fn compose_len(&self) -> u16

Returns the length in octets of the encoded name.
source§

fn starts_with<N: ToLabelIter + ?Sized>(&self, base: &N) -> bool

Determines whether base is a prefix of self.
source§

fn ends_with<N: ToLabelIter + ?Sized>(&self, base: &N) -> bool

Determines whether base is a suffix of self.
source§

impl<L: ToRelativeName, R: ToName> ToName for Chain<L, R>

source§

fn try_to_name<Octets>( &self, ) -> Result<Name<Octets>, BuilderAppendError<Octets>>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: EmptyBuilder,

Converts the name into a single, uncompressed name. Read more
source§

fn to_name<Octets>(&self) -> Name<Octets>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,

Converts the name into a single, uncompressed name. Read more
source§

fn try_to_canonical_name<Octets>( &self, ) -> Result<Name<Octets>, BuilderAppendError<Octets>>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: EmptyBuilder,

Converts the name into a single name in canonical form.
source§

fn to_canonical_name<Octets>(&self) -> Name<Octets>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,

Converts the name into a single name in canonical form. Read more
source§

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

Returns an octets slice of the content if possible. Read more
source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

fn compose_canonical<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

fn to_cow(&self) -> Name<Cow<'_, [u8]>>

Returns a cow of the domain name. Read more
source§

fn to_vec(&self) -> Name<Vec<u8>>

Returns the domain name assembled into a Vec<u8>.
source§

fn to_bytes(&self) -> Name<Bytes>

Returns the domain name assembled into a bytes value.
source§

fn name_eq<N: ToName + ?Sized>(&self, other: &N) -> bool

Tests whether self and other are equal. Read more
source§

fn name_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering

Returns the ordering between self and other. Read more
source§

fn composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering

Returns the composed name ordering.
source§

fn lowercase_composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering

Returns the lowercase composed ordering.
source§

fn rrsig_label_count(&self) -> u8

Returns the number of labels for the RRSIG Labels field. Read more
source§

impl<Octets, R> ToName for Chain<UncertainName<Octets>, R>
where Octets: AsRef<[u8]>, R: ToName,

source§

fn try_to_name<Octets>( &self, ) -> Result<Name<Octets>, BuilderAppendError<Octets>>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: EmptyBuilder,

Converts the name into a single, uncompressed name. Read more
source§

fn to_name<Octets>(&self) -> Name<Octets>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,

Converts the name into a single, uncompressed name. Read more
source§

fn try_to_canonical_name<Octets>( &self, ) -> Result<Name<Octets>, BuilderAppendError<Octets>>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: EmptyBuilder,

Converts the name into a single name in canonical form.
source§

fn to_canonical_name<Octets>(&self) -> Name<Octets>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,

Converts the name into a single name in canonical form. Read more
source§

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

Returns an octets slice of the content if possible. Read more
source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

fn compose_canonical<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

fn to_cow(&self) -> Name<Cow<'_, [u8]>>

Returns a cow of the domain name. Read more
source§

fn to_vec(&self) -> Name<Vec<u8>>

Returns the domain name assembled into a Vec<u8>.
source§

fn to_bytes(&self) -> Name<Bytes>

Returns the domain name assembled into a bytes value.
source§

fn name_eq<N: ToName + ?Sized>(&self, other: &N) -> bool

Tests whether self and other are equal. Read more
source§

fn name_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering

Returns the ordering between self and other. Read more
source§

fn composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering

Returns the composed name ordering.
source§

fn lowercase_composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering

Returns the lowercase composed ordering.
source§

fn rrsig_label_count(&self) -> u8

Returns the number of labels for the RRSIG Labels field. Read more
source§

impl<L: ToRelativeName, R: ToRelativeName> ToRelativeName for Chain<L, R>

source§

fn try_to_relative_name<Octets>( &self, ) -> Result<RelativeName<Octets>, BuilderAppendError<Octets>>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: EmptyBuilder,

Converts the name into a single, continous name. Read more
source§

fn to_relative_name<Octets>(&self) -> RelativeName<Octets>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,

Converts the name into a single, continous name. Read more
source§

fn try_to_canonical_relative_name<Octets>( &self, ) -> Result<RelativeName<Octets>, BuilderAppendError<Octets>>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: EmptyBuilder,

Converts the name into a single name in canonical form.
source§

fn to_canonical_relative_name<Octets>(&self) -> RelativeName<Octets>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,

Converts the name into a single name in canonical form. Read more
source§

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

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

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

fn compose_canonical<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

fn to_cow(&self) -> RelativeName<Cow<'_, [u8]>>

Returns a cow of the relative domain name. Read more
source§

fn to_vec(&self) -> RelativeName<Vec<u8>>

Returns the domain name assembled into a Vec<u8>.
source§

fn to_bytes(&self) -> RelativeName<Bytes>

Returns the domain name assembled into a bytes value.
source§

fn is_empty(&self) -> bool

Returns whether the name is empty.
source§

fn chain<N: ToLabelIter>( self, suffix: N, ) -> Result<Chain<Self, N>, LongChainError>
where Self: Sized,

Returns a chain of this name and the provided name.
source§

fn chain_root(self) -> Chain<Self, Name<&'static [u8]>>
where Self: Sized,

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

fn name_eq<N: ToRelativeName + ?Sized>(&self, other: &N) -> bool

Tests whether self and other are equal. Read more
source§

fn name_cmp<N: ToRelativeName + ?Sized>(&self, other: &N) -> Ordering

Returns the ordering between self and other. Read more

Auto Trait Implementations§

§

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

§

impl<L, R> RefUnwindSafe for Chain<L, R>

§

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,

§

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

§

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

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

source§

type Error = <Target as OctetsFrom<Source>>::Error

source§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
source§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more