Struct trust_dns_proto::rr::domain::Label [−][src]
Labels are always stored as ASCII, unicode characters must be encoded with punycode
Implementations
impl Label
[src]
pub fn from_raw_bytes(bytes: &[u8]) -> ProtoResult<Self>
[src]
These must only be ASCII, with unicode encoded to PunyCode, or other such transformation.
This uses the bytes as raw ascii values, with nothing escaped on the wire.
Generally users should use from_str
or from_ascii
pub fn from_utf8(s: &str) -> ProtoResult<Self>
[src]
Translates this string into IDNA safe name, encoding to punycode as necessary.
pub fn from_ascii(s: &str) -> ProtoResult<Self>
[src]
Takes the ascii string and returns a new label.
This will return an Error if the label is not an ascii string
pub fn wildcard() -> Self
[src]
Returns a new Label of the Wildcard, i.e. “*”
pub fn to_lowercase(&self) -> Self
[src]
Converts this label to lowercase
pub fn is_wildcard(&self) -> bool
[src]
Returns true if this label is the wildcard, ‘*’, label
pub fn len(&self) -> usize
[src]
Returns the lenght in bytes of this label
pub fn is_empty(&self) -> bool
[src]
True if the label contains no characters
pub fn as_bytes(&self) -> &[u8]
[src]
Returns the raw bytes of the label, this is good for writing to the wire.
See Display
for presentation version (unescaped from punycode, etc)
pub fn eq_ignore_ascii_case(&self, other: &Self) -> bool
[src]
Performs the equivalence operation disregarding case
pub fn cmp_with_f<F: LabelCmp>(&self, other: &Self) -> Ordering
[src]
compares with the other label, ignoring case
pub fn to_utf8(&self) -> String
[src]
Performs the conversion to utf8 from IDNA as necessary, see fmt
for more details
pub fn to_ascii(&self) -> String
[src]
Converts this label to safe ascii, escaping characters as necessary
If this is an IDNA, punycode, label, then the xn– prefix will be maintained as ascii
pub fn write_ascii<W: Write>(&self, f: &mut W) -> Result<(), Error>
[src]
Writes this label to safe ascii, escaping characters as necessary
Trait Implementations
impl AsRef<[u8]> for Label
[src]
impl Borrow<[u8]> for Label
[src]
impl Clone for Label
[src]
impl Debug for Label
[src]
impl Display for Label
[src]
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
[src]
outputs characters in a safe string manner.
if the string is punycode, i.e. starts with xn--
, otherwise it translates to a safe ascii string
escaping characters as necessary.
impl Eq for Label
[src]
impl Hash for Label
[src]
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> IntoLabel for &'a Label
[src]
fn into_label(self) -> ProtoResult<Label>
[src]
impl IntoLabel for Label
[src]
fn into_label(self) -> ProtoResult<Label>
[src]
impl Ord for Label
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Label> for Label
[src]
impl PartialOrd<Label> for Label
[src]
fn partial_cmp(&self, other: &Label) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Label
[src]
Auto Trait Implementations
impl RefUnwindSafe for Label
impl Send for Label
impl Sync for Label
impl Unpin for Label
impl UnwindSafe for Label
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,