Enum domain::bits::name::Labelette
[−]
[src]
pub enum Labelette<'a> { Normal(&'a [u8]), Bit(bool), }
A labelette is an atomic label.
Various operations on domain names such as comparisons or ordering are done label by label. However, binary labels are actually a sequence of labels themselves. Worse, a binary label within a name can actually be broken up into several binary labels with the same overall number of bits while still retaining the same domain name. All these operations need to consider the individual bits labels of a binary label.
In order to disperse the confusion of having labels inside labels, we invented the term labelette exclusively for this crate to mean either a normal label or one single bit-label of a binary label.
You get labelettes by iterating over Label
s. For a normal label, this
iterator will return exactly once with a Normal
variant. For binary
labels, the iterator will return once for each bit label with the Bit
variant.
Variants
Normal(&'a [u8])
A labelette for a normal label.
Bit(bool)
A labelette for a single bit-label of a binary label.
Methods
impl<'a> Labelette<'a>
[src]
Trait Implementations
impl<'a> PartialEq for Labelette<'a>
[src]
fn eq(&self, other: &Self) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> Eq for Labelette<'a>
[src]
impl<'a> PartialOrd for Labelette<'a>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a> Ord for Labelette<'a>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
Returns the ordering between self
and other
.
The canonical sort order for labels is defined in section 6.1 of RFC 4034, that for binary labels in section 3.3 of RFC 2673.
In short, normal labels are ordered like octet strings except that
the case of ASCII letters is ignored. Bit labels sort before
normal labels and false
sorts before true
.
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<'a> Hash for Labelette<'a>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more