pub struct Mx<N> { /* private fields */ }
Expand description
Mx record data.
The Mx record specifies a host willing to serve as a mail exchange for the owner name.
The Mx record type is defined in RFC 1035, section 3.3.9.
Implementations§
source§impl<N> Mx<N>
impl<N> Mx<N>
sourcepub fn new(preference: u16, exchange: N) -> Self
pub fn new(preference: u16, exchange: N) -> Self
Creates a new Mx record data from the components.
sourcepub fn preference(&self) -> u16
pub fn preference(&self) -> u16
The preference for this record.
Defines an order if there are several Mx records for the same owner. Lower values are preferred.
pub fn scan<S: Scanner<Dname = N>>(scanner: &mut S) -> Result<Self, S::Error>
Trait Implementations§
source§impl<N: ToDname, NN: ToDname> CanonicalOrd<Mx<NN>> for Mx<N>
impl<N: ToDname, NN: ToDname> CanonicalOrd<Mx<NN>> for Mx<N>
source§fn canonical_cmp(&self, other: &Mx<NN>) -> Ordering
fn canonical_cmp(&self, other: &Mx<NN>) -> Ordering
Returns the canonical ordering between
self
and other
.source§fn canonical_lt(&self, other: &Rhs) -> bool
fn canonical_lt(&self, other: &Rhs) -> bool
Returns whether
self
is canonically less than other
.source§fn canonical_le(&self, other: &Rhs) -> bool
fn canonical_le(&self, other: &Rhs) -> bool
Returns whether
self
is canonically less than or equal to other
.source§fn canonical_gt(&self, other: &Rhs) -> bool
fn canonical_gt(&self, other: &Rhs) -> bool
Returns whether
self
is canonically greater than other
.source§fn canonical_ge(&self, other: &Rhs) -> bool
fn canonical_ge(&self, other: &Rhs) -> bool
Returns whether
self
is canonically greater than or equal to other
.source§impl<Name: ToDname> ComposeRecordData for Mx<Name>
impl<Name: ToDname> ComposeRecordData for Mx<Name>
source§fn rdlen(&self, compress: bool) -> Option<u16>
fn rdlen(&self, compress: bool) -> Option<u16>
Returns the length of the record data if available. Read more
source§fn compose_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Appends the wire format of the record data into
target
.source§fn compose_canonical_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_canonical_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Appends the canonical wire format of the record data into
target
.source§fn compose_len_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_len_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Appends the record data prefixed with its length.
source§fn compose_canonical_len_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_canonical_len_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Appends the record data prefixed with its length.
source§impl<Name, TName> FlattenInto<Mx<TName>> for Mx<Name>where
Name: FlattenInto<TName>,
impl<Name, TName> FlattenInto<Mx<TName>> for Mx<Name>where
Name: FlattenInto<TName>,
type AppendError = <Name as FlattenInto<TName>>::AppendError
fn try_flatten_into(self) -> Result<Mx<TName>, Name::AppendError>
source§impl<O, N> From<Mx<N>> for AllRecordData<O, N>
impl<O, N> From<Mx<N>> for AllRecordData<O, N>
source§impl<O, N> From<Mx<N>> for ZoneRecordData<O, N>
impl<O, N> From<Mx<N>> for ZoneRecordData<O, N>
source§impl<Name, SrcName> OctetsFrom<Mx<SrcName>> for Mx<Name>where
Name: OctetsFrom<SrcName>,
impl<Name, SrcName> OctetsFrom<Mx<SrcName>> for Mx<Name>where
Name: OctetsFrom<SrcName>,
type Error = <Name as OctetsFrom<SrcName>>::Error
source§impl<N: ToDname> Ord for Mx<N>
impl<N: ToDname> Ord for Mx<N>
source§impl<'a, Octs: Octets + ?Sized> ParseRecordData<'a, Octs> for Mx<ParsedDname<Octs::Range<'a>>>
impl<'a, Octs: Octets + ?Sized> ParseRecordData<'a, Octs> for Mx<ParsedDname<Octs::Range<'a>>>
source§fn parse_rdata(
rtype: Rtype,
parser: &mut Parser<'a, Octs>,
) -> Result<Option<Self>, ParseError>
fn parse_rdata( rtype: Rtype, parser: &mut Parser<'a, Octs>, ) -> Result<Option<Self>, ParseError>
Parses the record data. Read more
source§impl<N, NN> PartialEq<Mx<NN>> for Mx<N>
impl<N, NN> PartialEq<Mx<NN>> for Mx<N>
source§impl<N, NN> PartialOrd<Mx<NN>> for Mx<N>
impl<N, NN> PartialOrd<Mx<NN>> for Mx<N>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<N> RecordData for Mx<N>
impl<N> RecordData for Mx<N>
impl<N: ToDname> Eq for Mx<N>
Auto Trait Implementations§
impl<N> Freeze for Mx<N>where
N: Freeze,
impl<N> RefUnwindSafe for Mx<N>where
N: RefUnwindSafe,
impl<N> Send for Mx<N>where
N: Send,
impl<N> Sync for Mx<N>where
N: Sync,
impl<N> Unpin for Mx<N>where
N: Unpin,
impl<N> UnwindSafe for Mx<N>where
N: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.