[][src]Struct domain_core::bits::question::Question

pub struct Question<N: ToDname> { /* fields omitted */ }

A question in a DNS message.

In DNS, a question describes what is requested in a query. It consists of three elements: a domain name, a record type, and a class. This type such a question.

Questions are generic over the domain name type. When read from an actual message, a ParsedDname has to be used because the name part may be compressed.

In order to allow questions on the fly, in particular when creating messages via MessageBuilder, the From trait is implemented for tuples of all three elements of a question as well as for only name and record type assuming Class::In which is likely what you want, anyway.

Methods

impl<N: ToDname> Question<N>[src]

pub fn new(qname: N, qtype: Rtype, qclass: Class) -> Self[src]

Creates a new question from its three componets.

pub fn new_in(qname: N, qtype: Rtype) -> Self[src]

Creates a new question from a name and record type, assuming class IN.

impl<N: ToDname> Question<N>[src]

pub fn qname(&self) -> &N[src]

Returns a reference to the domain nmae in the question,

pub fn qtype(&self) -> Rtype[src]

Returns the record type of the question.

pub fn qclass(&self) -> Class[src]

Returns the class of the question.

Trait Implementations

impl<N: ToDname> Compose for Question<N>[src]

impl<N: ToDname> Compress for Question<N>[src]

impl<N: ToDname + Parse> Parse for Question<N>[src]

type Err = <N as Parse>::Err

The type of an error returned when parsing fails.

impl<N: Eq + ToDname> Eq for Question<N>[src]

impl<N: Clone + ToDname> Clone for Question<N>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<N: PartialOrd + ToDname> PartialOrd<Question<N>> for Question<N>[src]

impl<N: PartialEq + ToDname> PartialEq<Question<N>> for Question<N>[src]

impl<N: Ord + ToDname> Ord for Question<N>[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<N: ToDname> From<(N, Rtype, Class)> for Question<N>[src]

impl<N: ToDname> From<(N, Rtype)> for Question<N>[src]

impl<N: Hash + ToDname> Hash for Question<N>[src]

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

Feeds a slice of this type into the given [Hasher]. Read more

impl<N: Debug + ToDname> Debug for Question<N>[src]

impl<N: ToDname + Display> Display for Question<N>[src]

Auto Trait Implementations

impl<N> Send for Question<N> where
    N: Send

impl<N> Sync for Question<N> where
    N: Sync

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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