[−][src]Trait domain::base::name::ToLabelIter
A type that can produce an iterator over its labels.
This trait is used as a trait bound for both ToDname
and
ToRelativeDname
. It is separate since it has to be generic over the
lifetime of the label reference but we don’t want to have this lifetime
parameter pollute those traits.
ToRelativeDname
: trait ToRelativeDname.html
Associated Types
type LabelIter: Iterator<Item = &'a Label> + DoubleEndedIterator + Clone
The type of the iterator over the labels.
This iterator types needs to be double ended so that we can deal with name suffixes. It needs to be cloneable to be able to cascade over parents of a name.
Required methods
fn iter_labels(&'a self) -> Self::LabelIter
Returns an iterator over the labels.
Provided methods
fn len(&'a self) -> usize
Returns the length in octets of the encoded name.
fn starts_with<N: ToLabelIter<'a> + ?Sized>(&'a self, base: &'a N) -> bool
Determines whether base
is a prefix of self
.
fn ends_with<N: ToLabelIter<'a> + ?Sized>(&'a self, base: &'a N) -> bool
Determines whether base
is a suffix of self
.
Implementations on Foreign Types
impl<'a, 'b, N: ToLabelIter<'b> + ?Sized> ToLabelIter<'b> for &'a N
[src]
type LabelIter = N::LabelIter
fn iter_labels(&'b self) -> Self::LabelIter
[src]
Implementors
impl<'a, L: ToRelativeDname, R: ToEitherDname> ToLabelIter<'a> for Chain<L, R>
[src]
type LabelIter = ChainIter<'a, L, R>
fn iter_labels(&'a self) -> Self::LabelIter
[src]
impl<'a, Octets, R> ToLabelIter<'a> for Chain<UncertainDname<Octets>, R> where
Octets: AsRef<[u8]>,
R: ToDname,
[src]
Octets: AsRef<[u8]>,
R: ToDname,
type LabelIter = UncertainChainIter<'a, Octets, R>
fn iter_labels(&'a self) -> Self::LabelIter
[src]
impl<'a, Octets: AsRef<[u8]>> ToLabelIter<'a> for UncertainDname<Octets>
[src]
type LabelIter = DnameIter<'a>
fn iter_labels(&'a self) -> Self::LabelIter
[src]
impl<'a, Octets: ?Sized> ToLabelIter<'a> for Dname<Octets> where
Octets: AsRef<[u8]>,
[src]
Octets: AsRef<[u8]>,
type LabelIter = DnameIter<'a>
fn iter_labels(&'a self) -> Self::LabelIter
[src]
fn len(&self) -> usize
[src]
impl<'a, Octets: ?Sized> ToLabelIter<'a> for RelativeDname<Octets> where
Octets: AsRef<[u8]>,
[src]
Octets: AsRef<[u8]>,