Skip to main content

RecordData

Enum RecordData 

Source
#[non_exhaustive]
pub enum RecordData<'a, N> {
Show 21 variants A(A), Ns(Ns<N>), CName(CName<N>), Soa(Soa<N>), Ptr(Ptr<N>), HInfo(HInfo<'a>), Mx(Mx<N>), Txt(&'a Txt), Rp(Rp<N>), Srv(&'a Srv), Aaaa(Aaaa), DName(&'a DName), Opt(&'a Opt), Ds(&'a Ds), Rrsig(Rrsig<'a>), Nsec(Nsec<'a>), DNSKey(&'a DNSKey), Nsec3(Nsec3<'a>), Nsec3Param(&'a Nsec3Param), ZoneMD(&'a ZoneMD), Unknown(RType, &'a UnknownRecordData),
}
Available on crate feature unstable-new only.
Expand description

DNS record data.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

A(A)

The IPv4 address of a host responsible for this domain.

§

Ns(Ns<N>)

The authoritative name server for this domain.

§

CName(CName<N>)

The canonical name for this domain.

§

Soa(Soa<N>)

The start of a zone of authority.

§

Ptr(Ptr<N>)

A pointer to another domain name.

§

HInfo(HInfo<'a>)

Information about the host computer.

§

Mx(Mx<N>)

A host that can exchange mail for this domain.

§

Txt(&'a Txt)

Free-form text strings about this domain.

§

Rp(Rp<N>)

Identification of the person/party responsible for this domain.

§

Srv(&'a Srv)

The locations of services associated with this domain.

§

Aaaa(Aaaa)

The IPv6 address of a host responsible for this domain.

§

DName(&'a DName)

Redirection for the descendants of this domain.

§

Opt(&'a Opt)

Extended DNS options.

§

Ds(&'a Ds)

The signing key of a delegated zone.

§

Rrsig(Rrsig<'a>)

A cryptographic signature on a DNS record set.

§

Nsec(Nsec<'a>)

An indication of the non-existence of a set of DNS records (version 1).

§

DNSKey(&'a DNSKey)

A cryptographic key for DNS security.

§

Nsec3(Nsec3<'a>)

An indication of the non-existence of a set of DNS records (version 3).

§

Nsec3Param(&'a Nsec3Param)

Parameters for computing Nsec3 records.

§

ZoneMD(&'a ZoneMD)

A message digest of the enclosing zone.

§

Unknown(RType, &'a UnknownRecordData)

Data for an unknown DNS record type.

Implementations§

Source§

impl<N> RecordData<'_, N>

Source

pub const fn rtype(&self) -> RType

The record data type.

Source§

impl<'a, N> RecordData<'a, N>

Source

pub fn map_names<R, F: FnMut(N) -> R>(self, f: F) -> RecordData<'a, R>

Map the domain names within to another type.

Source

pub fn map_names_by_ref<'r, R, F: FnMut(&'r N) -> R>( &'r self, f: F, ) -> RecordData<'r, R>

Map references to the domain names within to another type.

Source

pub fn clone_to_bump<'r>(&self, bump: &'r Bump) -> RecordData<'r, N>
where N: Clone,

Available on crate feature bumpalo only.

Copy referenced data into the given Bump allocator.

Trait Implementations§

Source§

impl<N: BuildBytes> BuildBytes for RecordData<'_, N>

Source§

fn build_bytes<'b>( &self, bytes: &'b mut [u8], ) -> Result<&'b mut [u8], TruncationError>

Serialize into a byte sequence. Read more
Source§

fn built_bytes_size(&self) -> usize

The size of self when serialized into a byte sequence. Read more
Source§

impl<N: BuildInMessage> BuildInMessage for RecordData<'_, N>

Source§

fn build_in_message( &self, contents: &mut [u8], start: usize, name: &mut NameCompressor, ) -> Result<usize, TruncationError>

Write this object in a DNS message. Read more
Source§

impl<N: CanonicalName> CanonicalRecordData for RecordData<'_, N>

Source§

fn build_canonical_bytes<'b>( &self, bytes: &'b mut [u8], ) -> Result<&'b mut [u8], TruncationError>

Serialize record data in the canonical form. Read more
Source§

fn cmp_canonical(&self, other: &Self) -> Ordering

Compare record data in the canonical form. Read more
Source§

impl<'a, N: Clone> Clone for RecordData<'a, N>

Source§

fn clone(&self) -> RecordData<'a, N>

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<'a, N: Debug> Debug for RecordData<'a, N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, N: Eq> Eq for RecordData<'a, N>

Source§

impl<'a, N> From<&'a DNSKey> for RecordData<'a, N>

Source§

fn from(value: &'a DNSKey) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<&'a DName> for RecordData<'a, N>

Source§

fn from(value: &'a DName) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<&'a Ds> for RecordData<'a, N>

Source§

fn from(value: &'a Ds) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<&'a Nsec3Param> for RecordData<'a, N>

Source§

fn from(value: &'a Nsec3Param) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<&'a Opt> for RecordData<'a, N>

Source§

fn from(value: &'a Opt) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<&'a Srv> for RecordData<'a, N>

Source§

fn from(value: &'a Srv) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<&'a Txt> for RecordData<'a, N>

Source§

fn from(value: &'a Txt) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<&'a ZoneMD> for RecordData<'a, N>

Source§

fn from(value: &'a ZoneMD) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<A> for RecordData<'a, N>

Source§

fn from(value: A) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<Aaaa> for RecordData<'a, N>

Source§

fn from(value: Aaaa) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<CName<N>> for RecordData<'a, N>

Source§

fn from(value: CName<N>) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<HInfo<'a>> for RecordData<'a, N>

Source§

fn from(value: HInfo<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<Mx<N>> for RecordData<'a, N>

Source§

fn from(value: Mx<N>) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<Ns<N>> for RecordData<'a, N>

Source§

fn from(value: Ns<N>) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<Nsec3<'a>> for RecordData<'a, N>

Source§

fn from(value: Nsec3<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<Nsec<'a>> for RecordData<'a, N>

Source§

fn from(value: Nsec<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<Ptr<N>> for RecordData<'a, N>

Source§

fn from(value: Ptr<N>) -> Self

Converts to this type from the input type.
Source§

impl<N: BuildBytes> From<RecordData<'_, N>> for BoxedRecordData

Available on crate feature alloc only.
Source§

fn from(value: RecordData<'_, N>) -> Self

Build a RecordData into a heap allocation.

§Panics

Panics if the RecordData does not fit in a 64KiB buffer, or if the serialized bytes cannot be parsed back into RecordData<'_, &Name>.

Source§

impl<'a, N> From<Rp<N>> for RecordData<'a, N>

Source§

fn from(value: Rp<N>) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<Rrsig<'a>> for RecordData<'a, N>

Source§

fn from(value: Rrsig<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a, N> From<Soa<N>> for RecordData<'a, N>

Source§

fn from(value: Soa<N>) -> Self

Converts to this type from the input type.
Source§

impl<'a, N: Hash> Hash for RecordData<'a, N>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, N: SplitMessageBytes<'a>> ParseRecordData<'a> for RecordData<'a, N>

Source§

fn parse_record_data( contents: &'a [u8], start: usize, rtype: RType, ) -> Result<Self, ParseError>

Parse DNS record data of the given type from a DNS message.
Source§

impl<'a, N: SplitBytes<'a>> ParseRecordDataBytes<'a> for RecordData<'a, N>

Source§

fn parse_record_data_bytes( bytes: &'a [u8], rtype: RType, ) -> Result<Self, ParseError>

Parse DNS record data of the given type from a byte sequence.
Source§

impl<'a, N: PartialEq> PartialEq for RecordData<'a, N>

Source§

fn eq(&self, other: &RecordData<'a, N>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a, N: PartialEq> StructuralPartialEq for RecordData<'a, N>

Auto Trait Implementations§

§

impl<'a, N> Freeze for RecordData<'a, N>
where N: Freeze,

§

impl<'a, N> RefUnwindSafe for RecordData<'a, N>
where N: RefUnwindSafe,

§

impl<'a, N> Send for RecordData<'a, N>
where N: Send,

§

impl<'a, N> Sync for RecordData<'a, N>
where N: Sync,

§

impl<'a, N> Unpin for RecordData<'a, N>
where N: Unpin,

§

impl<'a, N> UnsafeUnpin for RecordData<'a, N>
where N: UnsafeUnpin,

§

impl<'a, N> UnwindSafe for RecordData<'a, N>
where N: UnwindSafe,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

Source§

type Error = <Target as OctetsFrom<Source>>::Error

Source§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
Source§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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