[][src]Trait domain::base::name::ToLabelIter

pub trait ToLabelIter<'a> {
    type LabelIter: Iterator<Item = &'a Label> + DoubleEndedIterator + Clone;
    fn iter_labels(&'a self) -> Self::LabelIter;

    fn len(&'a self) -> usize { ... }
fn starts_with<N: ToLabelIter<'a> + ?Sized>(&'a self, base: &'a N) -> bool { ... }
fn ends_with<N: ToLabelIter<'a> + ?Sized>(&'a self, base: &'a N) -> bool { ... } }

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.

Loading content...

Required methods

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

Returns an iterator over the labels.

Loading content...

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.

Loading content...

Implementations on Foreign Types

impl<'a, 'b, N: ToLabelIter<'b> + ?Sized> ToLabelIter<'b> for &'a N[src]

type LabelIter = N::LabelIter

Loading content...

Implementors

impl<'a, L: ToRelativeDname, R: ToEitherDname> ToLabelIter<'a> for Chain<L, R>[src]

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

impl<'a, Octets, R> ToLabelIter<'a> for Chain<UncertainDname<Octets>, R> where
    Octets: AsRef<[u8]>,
    R: ToDname
[src]

type LabelIter = UncertainChainIter<'a, Octets, R>

impl<'a, Octets: AsRef<[u8]>> ToLabelIter<'a> for UncertainDname<Octets>[src]

type LabelIter = DnameIter<'a>

impl<'a, Octets: ?Sized> ToLabelIter<'a> for Dname<Octets> where
    Octets: AsRef<[u8]>, 
[src]

type LabelIter = DnameIter<'a>

impl<'a, Octets: ?Sized> ToLabelIter<'a> for RelativeDname<Octets> where
    Octets: AsRef<[u8]>, 
[src]

type LabelIter = DnameIter<'a>

impl<'a, Ref: AsRef<[u8]>> ToLabelIter<'a> for ParsedDname<Ref>[src]

type LabelIter = ParsedDnameIter<'a>

Loading content...