pub trait ToLabelIter<'a> {
type LabelIter: Iterator<Item = &'a Label> + DoubleEndedIterator;
// Required method
fn iter_labels(&'a self) -> Self::LabelIter;
// Provided methods
fn starts_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool { ... }
fn ends_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool { ... }
}Expand description
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
Required Associated Types§
Sourcetype LabelIter: Iterator<Item = &'a Label> + DoubleEndedIterator
type LabelIter: Iterator<Item = &'a Label> + DoubleEndedIterator
The type of the iterator over the labels.
This iterator types needs to be double ended so that we can deal with name suffixes.
Required Methods§
Sourcefn iter_labels(&'a self) -> Self::LabelIter
fn iter_labels(&'a self) -> Self::LabelIter
Returns an iterator over the labels.
Provided Methods§
Sourcefn starts_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool
fn starts_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool
Determines whether base is a prefix of self.
Sourcefn ends_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool
fn ends_with<N: ToLabelIter<'a>>(&'a self, base: &'a N) -> bool
Determines whether base is a suffix of self.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.