pub struct SpfOutput { /* private fields */ }Expand description
The outcome of an SPF check.
Returned by MessageAuthenticator::verify_spf and
MessageAuthenticator::check_host. Besides the SpfResult, it
carries the checked domain, the explanation string of a fail result and
the RFC 6652 report address, when the record requests a report for this
result. SpfOutput::new and SpfOutput::with_result build a
synthetic output, for example to feed DMARC with a result obtained
elsewhere.
Implementations§
Source§impl SpfOutput
impl SpfOutput
Sourcepub fn new(domain: String) -> Self
pub fn new(domain: String) -> Self
Creates an output for domain with result SpfResult::None, no
explanation and no report address.
Sourcepub fn with_result(self, result: SpfResult) -> Self
pub fn with_result(self, result: SpfResult) -> Self
Sets the result.
Sourcepub fn with_report(self, spf: &SpfRecord) -> Self
pub fn with_report(self, spf: &SpfRecord) -> Self
Sets the report address to <ra>@<domain> when spf has an ra=
modifier, its rr= bitmask covers the current result and the message
is sampled by rp= (RFC 6652, Section 3). Call it after
SpfOutput::with_result; a pass result never produces a report.
Sourcepub fn with_explanation(self, explanation: String) -> Self
pub fn with_explanation(self, explanation: String) -> Self
Sets the explanation string (RFC 7208, Section 6.2).
Sourcepub fn domain(&self) -> &str
pub fn domain(&self) -> &str
Returns the domain that was checked: the HELO domain or the domain of the MAIL FROM address.
Sourcepub fn explanation(&self) -> Option<&str>
pub fn explanation(&self) -> Option<&str>
Returns the expanded exp= explanation, set only on a fail result
whose record has an exp= modifier that resolved.
Sourcepub fn report_address(&self) -> Option<&str>
pub fn report_address(&self) -> Option<&str>
Returns the address that requested an authentication failure report for this result (RFC 6652), if any.
Trait Implementations§
impl Eq for SpfOutput
Auto Trait Implementations§
impl Freeze for SpfOutput
impl RefUnwindSafe for SpfOutput
impl Send for SpfOutput
impl Sync for SpfOutput
impl Unpin for SpfOutput
impl UnsafeUnpin for SpfOutput
impl UnwindSafe for SpfOutput
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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