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,
) -> ResolvedMxAddresses
pub async fn resolve_addresses( &self, resolver: Option<&dyn Resolver>, strategy: IpLookupStrategy, ) -> ResolvedMxAddresses
Returns the list of resolve MX hosts in reverse preference order; the first one to try is the last element. smtp_dispatcher.rs relies on this ordering, as it will pop off candidates until it has exhausted its connection plan.
Trait Implementations§
Source§impl Clone for MailExchanger
impl Clone for MailExchanger
Source§fn clone(&self) -> MailExchanger
fn clone(&self) -> MailExchanger
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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