Struct trust_dns_proto::op::query::Query [−][src]
pub struct Query { /* fields omitted */ }
Query struct for looking up resource records, basically a resource record without RDATA.
RFC 1035, DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION, November 1987
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 |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
Methods
impl Query
[src]
impl Query
pub fn new() -> Self
[src]
pub fn new() -> Self
Return a default query with an empty name and A, IN for the query_type and query_class
pub fn query(name: Name, query_type: RecordType) -> Self
[src]
pub fn query(name: Name, query_type: RecordType) -> Self
Create a new query from name and type, class defaults to IN
pub fn set_name(&mut self, name: Name) -> &mut Self
[src]
pub fn set_name(&mut self, name: Name) -> &mut Self
replaces name with the new name
pub fn set_query_type(&mut self, query_type: RecordType) -> &mut Self
[src]
pub fn set_query_type(&mut self, query_type: RecordType) -> &mut Self
Specify the RecordType being queried
pub fn set_query_class(&mut self, query_class: DNSClass) -> &mut Self
[src]
pub fn set_query_class(&mut self, query_class: DNSClass) -> &mut Self
Specify÷ the DNS class of the Query, almost always IN
pub fn name(&self) -> &Name
[src]
pub fn 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.
pub fn query_type(&self) -> RecordType
[src]
pub fn 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.
pub fn query_class(&self) -> DNSClass
[src]
pub fn 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 Clone for Query
[src]
impl Clone for Query
fn clone(&self) -> Query
[src]
fn clone(&self) -> Query
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Query
[src]
impl Debug for Query
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for Query
[src]
impl Eq for Query
impl Hash for Query
[src]
impl Hash for Query
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for Query
[src]
impl PartialEq for Query
fn eq(&self, other: &Query) -> bool
[src]
fn eq(&self, other: &Query) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Query) -> bool
[src]
fn ne(&self, other: &Query) -> bool
This method tests for !=
.
impl Default for Query
[src]
impl Default for Query
fn default() -> Self
[src]
fn default() -> Self
Return a default query with an empty name and A, IN for the query_type and query_class
impl BinEncodable for Query
[src]
impl BinEncodable for Query
fn emit(&self, encoder: &mut BinEncoder) -> ProtoResult<()>
[src]
fn emit(&self, encoder: &mut BinEncoder) -> ProtoResult<()>
Write the type to the stream
fn to_bytes(&self) -> ProtoResult<Vec<u8>>
[src]
fn to_bytes(&self) -> ProtoResult<Vec<u8>>
Returns the object in binary form
impl<'r> BinDecodable<'r> for Query
[src]
impl<'r> BinDecodable<'r> for Query
fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Self>
[src]
fn read(decoder: &mut BinDecoder<'r>) -> ProtoResult<Self>
Read the type from the stream
fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
[src]
fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
Returns the object in binary form
impl Display for Query
[src]
impl Display for Query