trust_dns_proto::rr::rdata::mx

Struct MX

Source
pub struct MX { /* private fields */ }
Expand description

RFC 1035, DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION, November 1987

3.3.9. MX RDATA format

    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    |                  PREFERENCE                   |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    /                   EXCHANGE                    /
    /                                               /
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

MX records cause type A additional section processing for the host
specified by EXCHANGE.  The use of MX RRs is explained in detail in
[RFC-974].

Implementations§

Source§

impl MX

Source

pub fn new(preference: u16, exchange: Name) -> Self

Constructs a new MX RData

§Arguments
  • preference - weight of this MX record as opposed to others, lower values have the higher preference
  • exchange - Name labels for the mail server
§Returns

A new MX RData for use in a Resource Record

Source

pub fn preference(&self) -> u16

RFC 1035, DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION, November 1987

PREFERENCE      A 16 bit integer which specifies the preference given to
                this RR among others at the same owner.  Lower values
                are preferred.
Source

pub fn exchange(&self) -> &Name

RFC 1035, DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION, November 1987

EXCHANGE        A <domain-name> which specifies a host willing to act as
                a mail exchange for the owner name.

Trait Implementations§

Source§

impl Clone for MX

Source§

fn clone(&self) -> MX

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 Debug for MX

Source§

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

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

impl Display for MX

RFC 1033, DOMAIN OPERATIONS GUIDE, November 1987

  MX (Mail Exchanger)  (See RFC-974 for more details.)

          <name>   [<ttl>] [<class>]   MX   <preference>   <host>

  MX records specify where mail for a domain name should be delivered.
  There may be multiple MX records for a particular name.  The
  preference value specifies the order a mailer should try multiple MX
  records when delivering mail.  Zero is the highest preference.
  Multiple records for the same name may have the same preference.

  A host BAR.FOO.COM may want its mail to be delivered to the host
  PO.FOO.COM and would then use the MX record:

          BAR.FOO.COM.    MX      10      PO.FOO.COM.

  A host BAZ.FOO.COM may want its mail to be delivered to one of three
  different machines, in the following order:

          BAZ.FOO.COM.    MX      10      PO1.FOO.COM.
                          MX      20      PO2.FOO.COM.
                          MX      30      PO3.FOO.COM.

  An entire domain of hosts not connected to the Internet may want
  their mail to go through a mail gateway that knows how to deliver
  mail to them.  If they would like mail addressed to any host in the
  domain FOO.COM to go through the mail gateway they might use:

          FOO.COM.        MX       10     RELAY.CS.NET.
          *.FOO.COM.      MX       20     RELAY.CS.NET.

  Note that you can specify a wildcard in the MX record to match on
  anything in FOO.COM, but that it won't match a plain FOO.COM.
Source§

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

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

impl Hash for MX

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 PartialEq for MX

Source§

fn eq(&self, other: &MX) -> 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 Eq for MX

Source§

impl StructuralPartialEq for MX

Auto Trait Implementations§

§

impl Freeze for MX

§

impl RefUnwindSafe for MX

§

impl Send for MX

§

impl Sync for MX

§

impl Unpin for MX

§

impl UnwindSafe for MX

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 T)

🔬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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<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> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more