simple_dns::rdata

Struct MR

Source
pub struct MR<'a>(pub Name<'a>);
Expand description

Mail rename domain name (EXPERIMENTAL), RFC 1035

Tuple Fields§

§0: Name<'a>

Implementations§

Source§

impl<'a> MR<'a>

Source

pub fn into_owned<'b>(self) -> MR<'b>

Transforms the inner data into its owned type

Methods from Deref<Target = Name<'a>>§

Verify if name ends with .local.

Source

pub fn iter(&'a self) -> Iter<'a, Label<'a>>

Returns an Iter of this Name Labels

Source

pub fn is_subdomain_of(&self, other: &Name<'_>) -> bool

Returns true if self is a subdomain of other

Source

pub fn without(&self, domain: &Name<'_>) -> Option<Name<'_>>

Returns the subdomain part of self, based on domain. If self is not a subdomain of domain, returns None

Example:

let name = Name::new_unchecked("sub.domain.local");
let domain = Name::new_unchecked("domain.local");

assert!(domain.without(&name).is_none());

let sub = name.without(&domain).unwrap();
assert_eq!(sub.to_string(), "sub")
Source

pub fn get_labels(&self) -> &[Label<'_>]

Get the labels that compose this name

Source

pub fn is_valid(&self) -> bool

Returns true if the name is valid.

Source

pub fn as_bytes(&self) -> impl Iterator<Item = &[u8]>

Returns the bytes of each of the labels that compose this Name

Trait Implementations§

Source§

impl<'a> Clone for MR<'a>

Source§

fn clone(&self) -> MR<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for MR<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Deref for MR<'a>

Source§

type Target = Name<'a>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a> DerefMut for MR<'a>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'a> From<Name<'a>> for MR<'a>

Source§

fn from(value: Name<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> Hash for MR<'a>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> PartialEq for MR<'a>

Source§

fn eq(&self, other: &MR<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Eq for MR<'a>

Source§

impl<'a> StructuralPartialEq for MR<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for MR<'a>

§

impl<'a> RefUnwindSafe for MR<'a>

§

impl<'a> Send for MR<'a>

§

impl<'a> Sync for MR<'a>

§

impl<'a> Unpin for MR<'a>

§

impl<'a> UnwindSafe for MR<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.