[][src]Struct dnsie::DnsRequest

pub struct DnsRequest<'a> {
    pub id: u16,
    pub query_name: Cow<'a, str>,
    pub query_kind: AnyQueryKind,
    pub ty: AnyDnsType,
    pub cls: AnyDnsClass,
}

DnsRequest is parsed(or manually constructed) dns request which may be serialized and sent to DNS server.

Right now the only serialization destination format is DNS binary but it may be serialized to some JSON specific for DNS resolver platform.

Note

It does not contain fields which are.

Fields

id: u16query_name: Cow<'a, str>

query_name is domain name represented as string

query_kind: AnyQueryKindty: AnyDnsTypecls: AnyDnsClass

Methods

impl<'a> DnsRequest<'a>[src]

pub fn make_simple(ty: AnyDnsType, domain: &'a str) -> Self[src]

make_simple constructs request with reasonable defaults to resolve given record type for given domain

impl<'a> DnsRequest<'a>[src]

pub fn to_dns_binary(&self, w: &mut impl Write) -> Result<(), Error>[src]

to_dns_binary serializes given request into DNS binary format.

Error

It returns error if writer fails. If some label can't be encoded for some reason appropriate std::io::Error is returned. Otherwise it always succeeds and returns Ok(()).

Note

Checks for name correctness aren't necessarily strict and thus this function may create invalid(according to RFC) dns request. This may happen for instance when there are too many labels.

Auto Trait Implementations

impl<'a> RefUnwindSafe for DnsRequest<'a>

impl<'a> Send for DnsRequest<'a>

impl<'a> Sync for DnsRequest<'a>

impl<'a> Unpin for DnsRequest<'a>

impl<'a> UnwindSafe for DnsRequest<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.