pub struct MailExchanger {
pub domain_name: String,
pub hosts: Vec<String>,
pub site_name: String,
pub by_pref: BTreeMap<u16, Vec<String>>,
pub is_domain_literal: bool,
pub is_secure: bool,
pub is_mx: bool,
pub mta_sts: PolicyMode,
/* private fields */
}Fields§
§domain_name: String§hosts: Vec<String>§site_name: String§by_pref: BTreeMap<u16, Vec<String>>§is_domain_literal: bool§is_secure: boolDNSSEC verified
is_mx: bool§mta_sts: PolicyModeThe applicable MTA-STS policy mode (PolicyMode::None when no policy
applies). hosts/by_pref already exclude any hosts disallowed by the
policy, so this is consulted only for TLS posture, not host gating.
Implementations§
Source§impl MailExchanger
impl MailExchanger
pub async fn resolve(domain_name: &str) -> Result<Arc<Self>>
Sourcepub async fn resolve_via(
domain_name: &str,
resolver: Option<&dyn Resolver>,
) -> Result<Arc<Self>>
pub async fn resolve_via( domain_name: &str, resolver: Option<&dyn Resolver>, ) -> Result<Arc<Self>>
Like resolve, but performs DNS via the supplied
resolver when one is provided. A supplied resolver bypasses the shared
MX cache so callers (such as tests using a fixture resolver) get
hermetic, order-independent results.
pub fn has_expired(&self) -> bool
Sourcepub async fn resolve_addresses(
&self,
resolver: Option<&dyn Resolver>,
strategy: IpLookupStrategy,
max_plan_size: usize,
max_addresses_per_host: usize,
) -> ResolvedMxAddresses
pub async fn resolve_addresses( &self, resolver: Option<&dyn Resolver>, strategy: IpLookupStrategy, max_plan_size: usize, max_addresses_per_host: usize, ) -> ResolvedMxAddresses
Returns the list of resolved MX hosts in reverse preference order.
max_addresses_per_host caps the A/AAAA addresses kept from any
single MX host, and max_plan_size caps the total across all hosts.
Both bound the plan: a destination publishing a very large number of
addresses cannot force an unbounded plan. When a cap truncates the
list, the addresses that are dropped are from the least-preferred
hosts.
Trait Implementations§
Source§impl Clone for MailExchanger
impl Clone for MailExchanger
Source§fn clone(&self) -> MailExchanger
fn clone(&self) -> MailExchanger
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MailExchanger
impl Debug for MailExchanger
Auto Trait Implementations§
impl Freeze for MailExchanger
impl RefUnwindSafe for MailExchanger
impl Send for MailExchanger
impl Sync for MailExchanger
impl Unpin for MailExchanger
impl UnwindSafe for MailExchanger
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more