pub struct NameSlice<'a>(/* private fields */);Expand description
This newtype struct allows the construction of a domain lib Name from
a bunch of &str labels represented as a slice.
Implements the domain lib ToName trait.
Implementations§
Trait Implementations§
Source§impl ToLabelIter for NameSlice<'_>
impl ToLabelIter for NameSlice<'_>
Source§type LabelIter<'t> = NameSliceIter<'t>
where
Self: 't
type LabelIter<'t> = NameSliceIter<'t> where Self: 't
The type of the iterator over the labels. Read more
Source§fn iter_labels(&self) -> Self::LabelIter<'_>
fn iter_labels(&self) -> Self::LabelIter<'_>
Returns an iterator over the labels.
Source§fn compose_len(&self) -> u16
fn compose_len(&self) -> u16
Returns the length in octets of the encoded name.
Source§fn starts_with<N>(&self, base: &N) -> boolwhere
N: ToLabelIter + ?Sized,
fn starts_with<N>(&self, base: &N) -> boolwhere
N: ToLabelIter + ?Sized,
Determines whether
base is a prefix of self.Source§impl ToName for NameSlice<'_>
impl ToName for NameSlice<'_>
Source§fn try_to_name<Octets>(
&self,
) -> Result<Name<Octets>, <<Octets as FromBuilder>::Builder as OctetsBuilder>::AppendError>
fn try_to_name<Octets>( &self, ) -> Result<Name<Octets>, <<Octets as FromBuilder>::Builder as OctetsBuilder>::AppendError>
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,
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>, <<Octets as FromBuilder>::Builder as OctetsBuilder>::AppendError>
fn try_to_canonical_name<Octets>( &self, ) -> Result<Name<Octets>, <<Octets as FromBuilder>::Builder as OctetsBuilder>::AppendError>
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,
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]>
fn as_flat_slice(&self) -> Option<&[u8]>
Returns an octets slice of the content if possible. Read more
fn compose<Target>(
&self,
target: &mut Target,
) -> Result<(), <Target as OctetsBuilder>::AppendError>where
Target: OctetsBuilder + ?Sized,
fn compose_canonical<Target>(
&self,
target: &mut Target,
) -> Result<(), <Target as OctetsBuilder>::AppendError>where
Target: OctetsBuilder + ?Sized,
Source§fn composed_cmp<N>(&self, other: &N) -> Ordering
fn composed_cmp<N>(&self, other: &N) -> Ordering
Returns the composed name ordering.
Source§fn lowercase_composed_cmp<N>(&self, other: &N) -> Ordering
fn lowercase_composed_cmp<N>(&self, other: &N) -> Ordering
Returns the lowercase composed ordering.
Source§fn rrsig_label_count(&self) -> u8
fn rrsig_label_count(&self) -> u8
Returns the number of labels for the RRSIG Labels field. Read more
fn fmt_with_dot(&self) -> DisplayWithDot<'_, Self>
Auto Trait Implementations§
impl<'a> Freeze for NameSlice<'a>
impl<'a> RefUnwindSafe for NameSlice<'a>
impl<'a> Send for NameSlice<'a>
impl<'a> Sync for NameSlice<'a>
impl<'a> Unpin for NameSlice<'a>
impl<'a> UnwindSafe for NameSlice<'a>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
Source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
Source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.