pub struct Parameters<'x, P, C: DnsCache = NoCache> {
pub input: P,
pub cache: Option<&'x C>,
}Expand description
The input of a verifier, optionally paired with a DNS cache.
Every verifier on MessageAuthenticator
takes impl Into<Parameters<..>>, so the bare input (a message, an IP
address, SPF or DMARC parameters) can be passed directly when no cache is
needed. Wrap it with Parameters::new and
with_cache to use a cache.
Fields§
§input: PThe verifier input.
cache: Option<&'x C>The DNS cache, or None to query without caching.
Implementations§
Source§impl<P> Parameters<'_, P, NoCache>
impl<P> Parameters<'_, P, NoCache>
Source§impl<'x, P, C: DnsCache> Parameters<'x, P, C>
impl<'x, P, C: DnsCache> Parameters<'x, P, C>
Sourcepub fn with_cache<NewC: DnsCache>(
self,
cache: &'x NewC,
) -> Parameters<'x, P, NewC>
pub fn with_cache<NewC: DnsCache>( self, cache: &'x NewC, ) -> Parameters<'x, P, NewC>
Sets the DNS cache, replacing any cache set before.
Sourcepub fn clone_with<NewP>(&self, input: NewP) -> Parameters<'x, NewP, C>
pub fn clone_with<NewP>(&self, input: NewP) -> Parameters<'x, NewP, C>
Returns parameters with a different input and the same cache. Useful for running several verifiers against one cache.
Trait Implementations§
Source§impl<'x> From<&'x AuthenticatedMessage<'x>> for Parameters<'x, &'x AuthenticatedMessage<'x>, NoCache>
impl<'x> From<&'x AuthenticatedMessage<'x>> for Parameters<'x, &'x AuthenticatedMessage<'x>, NoCache>
Source§fn from(params: &'x AuthenticatedMessage<'x>) -> Self
fn from(params: &'x AuthenticatedMessage<'x>) -> Self
Converts to this type from the input type.
Source§impl<'x, R, S> From<&'x Dkim2Dsn<'x, R, S>> for Parameters<'x, &'x Dkim2Dsn<'x, R, S>, NoCache>
impl<'x, R, S> From<&'x Dkim2Dsn<'x, R, S>> for Parameters<'x, &'x Dkim2Dsn<'x, R, S>, NoCache>
Source§impl<'x> From<DmarcParameters<'x>> for Parameters<'x, DmarcParameters<'x>, NoCache>
impl<'x> From<DmarcParameters<'x>> for Parameters<'x, DmarcParameters<'x>, NoCache>
Source§fn from(params: DmarcParameters<'x>) -> Self
fn from(params: DmarcParameters<'x>) -> Self
Converts to this type from the input type.
Source§impl<'x> From<SpfParameters<'x>> for Parameters<'x, SpfParameters<'x>, NoCache>
impl<'x> From<SpfParameters<'x>> for Parameters<'x, SpfParameters<'x>, NoCache>
Source§fn from(params: SpfParameters<'x>) -> Self
fn from(params: SpfParameters<'x>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'x, P, C> Freeze for Parameters<'x, P, C>
impl<'x, P, C> RefUnwindSafe for Parameters<'x, P, C>
impl<'x, P, C> Send for Parameters<'x, P, C>
impl<'x, P, C> Sync for Parameters<'x, P, C>
impl<'x, P, C> Unpin for Parameters<'x, P, C>
impl<'x, P, C> UnsafeUnpin for Parameters<'x, P, C>
impl<'x, P, C> UnwindSafe for Parameters<'x, P, C>
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> 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> ⓘ
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