Struct trust_dns::op::query::Query [] [src]

pub struct Query {
    // some fields omitted

Query struct for looking up resource records, basically a resource record without RDATA.


4.1.2. Question section format

The question section is used to carry the "question" in most queries,
i.e., the parameters that define what is being asked.  The section
contains QDCOUNT (usually 1) entries, each of the following format:

                                    1  1  1  1  1  1
      0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
    |                                               |
    /                     QNAME / ZNAME             /
    /                                               /
    |                     QTYPE / ZTYPE             |
    |                     QCLASS / ZCLASS           |


impl Query

fn new() -> Self

return a default query with an empty name and A, IN for the query_type and query_class

fn name(&mut self, name: Name) -> &mut Self

replaces name with the new name

fn query_type(&mut self, query_type: RecordType) -> &mut Self

fn query_class(&mut self, query_class: DNSClass) -> &mut Self

fn get_name(&self) -> &Name

QNAME           a domain name represented as a sequence of labels, where
                each label consists of a length octet followed by that
                number of octets.  The domain name terminates with the
                zero length octet for the null label of the root.  Note
                that this field may be an odd number of octets; no
                padding is used.

fn get_query_type(&self) -> RecordType

QTYPE           a two octet code which specifies the type of the query.
                The values for this field include all codes valid for a
                TYPE field, together with some more general codes which
                can match more than one type of RR.

fn get_query_class(&self) -> DNSClass

QCLASS          a two octet code that specifies the class of the query.
                For example, the QCLASS field is IN for the Internet.

Trait Implementations

impl BinSerializable<Query> for Query

fn read(decoder: &mut BinDecoder) -> DecodeResult<Self>

fn emit(&self, encoder: &mut BinEncoder) -> EncodeResult

Derived Implementations

impl Debug for Query

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl PartialEq for Query

fn eq(&self, __arg_0: &Query) -> bool

fn ne(&self, __arg_0: &Query) -> bool