Skip to main content

TxtRecord

Enum TxtRecord 

Source
pub enum TxtRecord {
    Spf(Arc<SpfRecord>),
    SpfExplanation(Arc<Macro>),
    DomainKey(Arc<DomainKey>),
    DkimReport(Arc<DkimReportRecord>),
    Dmarc(Arc<DmarcRecord>),
    Atps(Arc<AtpsRecord>),
    MtaSts(Arc<MtaStsRecord>),
    TlsRpt(Arc<TlsRptRecord>),
    Error(Error),
}
Expand description

A parsed DNS TXT record, as stored in the TXT ResolverCache of a DnsCache.

MessageAuthenticator::txt_lookup parses the TXT answer into the record type the caller asked for and caches the outcome as a TxtRecord, so a cache hit skips both the query and the parse. When no TXT record of the requested type parses, the error is cached as TxtRecord::Error, and so is a negative answer (NXDOMAIN or NODATA) that carries an SOA record; resolver failures are not cached. Each record type converts into its variant with From, which lets cache implementations pre-populate entries.

Variants§

§

Spf(Arc<SpfRecord>)

An SPF record (RFC 7208 Section 4.5).

§

SpfExplanation(Arc<Macro>)

The explanation string fetched from the target of an SPF exp= modifier (RFC 7208 Section 6.2), kept unexpanded.

§

DomainKey(Arc<DomainKey>)

A DKIM public key record (RFC 6376 Section 3.6.1).

§

DkimReport(Arc<DkimReportRecord>)

A DKIM failure reporting record (RFC 6651 Section 3).

§

Dmarc(Arc<DmarcRecord>)

A DMARC policy record (RFC 9989).

§

Atps(Arc<AtpsRecord>)

A DKIM Authorized Third-Party Signatures record (RFC 6541 Section 4).

§

MtaSts(Arc<MtaStsRecord>)

An MTA-STS record (RFC 8461 Section 3.1).

§

TlsRpt(Arc<TlsRptRecord>)

An SMTP TLS Reporting record (RFC 8460 Section 3).

§

Error(Error)

No TXT record at the name parsed as the requested type, or the name has no TXT records. Holds the error returned to the caller.

Implementations§

Source§

impl TxtRecord

Source

pub fn heap_size(&self) -> usize

Approximate heap memory owned by this record, in bytes, including the shared allocation of the parsed record. Walks the record once, so cache implementations should compute it when the entry is inserted.

Trait Implementations§

Source§

impl Clone for TxtRecord

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl From<AtpsRecord> for TxtRecord

Source§

fn from(v: AtpsRecord) -> Self

Converts to this type from the input type.
Source§

impl From<DkimReportRecord> for TxtRecord

Source§

fn from(v: DkimReportRecord) -> Self

Converts to this type from the input type.
Source§

impl From<DmarcRecord> for TxtRecord

Source§

fn from(v: DmarcRecord) -> Self

Converts to this type from the input type.
Source§

impl From<DomainKey> for TxtRecord

Source§

fn from(v: DomainKey) -> Self

Converts to this type from the input type.
Source§

impl From<Macro> for TxtRecord

Source§

fn from(v: Macro) -> Self

Converts to this type from the input type.
Source§

impl From<MtaStsRecord> for TxtRecord

Source§

fn from(v: MtaStsRecord) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<TxtRecord>> From<Result<T, Error>> for TxtRecord

Source§

fn from(v: Result<T>) -> Self

Converts to this type from the input type.
Source§

impl From<SpfRecord> for TxtRecord

Source§

fn from(v: SpfRecord) -> Self

Converts to this type from the input type.
Source§

impl From<TlsRptRecord> for TxtRecord

Source§

fn from(v: TlsRptRecord) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more