Skip to main content

DnsRecordData

Enum DnsRecordData 

Source
pub enum DnsRecordData {
    Hostname(String),
    Soa {
        mname: String,
        rname: String,
        serial: u32,
        refresh: u32,
        retry: u32,
        expire: u32,
        minimum_ttl: u32,
    },
    Mx {
        preference: u16,
        host: String,
    },
    Srv {
        target: String,
        priority: u16,
        weight: u16,
        port: u16,
    },
    Uri {
        target: String,
        priority: u16,
        weight: u16,
    },
    Cert {
        cert_type: u16,
        key_tag: u16,
        algorithm: u8,
        data: Vec<u8>,
    },
    Raw(Vec<u8>),
}
Expand description

Данные записи. Вид данных определяется типом записи: NS, CNAME, PTR и DNAME — Hostname; SOA, MX, SRV, URI, CERT — одноимённые варианты; всё остальное — Raw.

Variants§

§

Hostname(String)

Имя узла: для записей NS, CNAME, PTR и DNAME.

§

Soa

Начало зоны (SOA).

Fields

§mname: String

Основной сервер имён зоны.

§rname: String

Почтовый адрес ответственного, записанный как имя.

§serial: u32

Номер версии зоны.

§refresh: u32

Через сколько секунд вторичный сервер проверяет обновление.

§retry: u32

Через сколько секунд повторять неудавшуюся проверку.

§expire: u32

Через сколько секунд без связи зона считается устаревшей.

§minimum_ttl: u32

Срок хранения отрицательных ответов, в секундах.

§

Mx

Почтовый сервер (MX).

Fields

§preference: u16

Предпочтение: меньшее значение пробуют раньше.

§host: String

Имя почтового сервера.

§

Srv

Расположение службы (SRV).

Fields

§target: String

Имя узла, на котором работает служба.

§priority: u16

Приоритет: меньшее значение пробуют раньше.

§weight: u16

Вес при выборе среди записей одного приоритета.

§port: u16

Порт службы.

§

Uri

Адрес ресурса (URI).

Fields

§target: String

Сам адрес.

§priority: u16

Приоритет: меньшее значение пробуют раньше.

§weight: u16

Вес при выборе среди записей одного приоритета.

§

Cert

Сертификат (CERT).

Fields

§cert_type: u16

Вид сертификата.

§key_tag: u16

Метка ключа.

§algorithm: u8

Алгоритм ключа.

§data: Vec<u8>

Данные сертификата.

§

Raw(Vec<u8>)

Данные записи любого другого типа в том виде, в каком они идут в пакете: например, 4 байта адреса для A и 16 для AAAA.

Trait Implementations§

Source§

impl Clone for DnsRecordData

Source§

fn clone(&self) -> DnsRecordData

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 Debug for DnsRecordData

Source§

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

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

impl Eq for DnsRecordData

Source§

impl PartialEq for DnsRecordData

Source§

fn eq(&self, other: &DnsRecordData) -> bool

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DnsRecordData

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, 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> 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.