Struct cdns_rs::sync::query::QDns

source ·
pub struct QDns<'req> { /* private fields */ }
Expand description

A main instance which contains all common logic.

Implementations§

source§

impl<'req> QDns<'req>

source

pub fn make_empty( resolvers: Arc<ResolveConfig>, planned_reqs_len: usize, opts: QuerySetup ) -> Self

Initializes new empty storage for requests.

In some cases it is good idea to combine different requests, because by default all requests are performed in parallel. But in some cases it is bad idea.

§Arguments
  • resolvers - an Arc ResolveConfig which contains configuration i.e nameservers

  • planned_reqs_len - how many requests are planned

  • opts - QuerySetup additional options or overrides. Use default() for default values.

§Returns

Never panics. Returns Self.

source

pub fn add_request<R>(&mut self, qtype: QType, req_name: R)
where R: Into<QDnsName<'req>>,

Adds new request to previously created empty storage for request with QDns::make_empty.

§Arguemnts
  • qtype - a QType type of the request

  • req_name - a Into QDnsName which is target. i.e ‘localhost’ or ‘domain.tld’

§Returns
source

pub fn make_a_aaaa_request<R>( resolvers: Arc<ResolveConfig>, req_name: R, opts: QuerySetup ) -> CDnsResult<Self>
where R: Into<QDnsName<'req>>,

This is helper which makes for you an A, AAAA query. The order of A and AAAA and which from both are allowed is defined in the ResolveConfig.

Use this function directly. Do not use QDns::make_empty

§Arguments
  • resolvers - an Arc ResolveConfig which contains configuration i.e nameservers

  • req_name - a Into QDnsName which is target i.e ‘localhost’ or ‘domain.tld’

  • opts - QuerySetup additional options or overrides. Use default() for default values.

§Returns
source

pub fn query(self) -> QDnsQueriesRes

Runs the created query/ies

§Returns

Should not panic. MT-safe.

Auto Trait Implementations§

§

impl<'req> Freeze for QDns<'req>

§

impl<'req> RefUnwindSafe for QDns<'req>

§

impl<'req> Send for QDns<'req>

§

impl<'req> Sync for QDns<'req>

§

impl<'req> Unpin for QDns<'req>

§

impl<'req> UnwindSafe for QDns<'req>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V