pub struct Question {
pub name: DomainName,
pub qtype: QueryType,
pub qclass: QueryClass,
}
Expand description
The question section has a list of questions (usually 1 but possibly more) being asked. This is the structure for a single question.
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| |
/ QNAME /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QTYPE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QCLASS |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
See section 4.1.2 of RFC 1035.
Fields§
§name: DomainName
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.
qtype: QueryType
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.
qclass: QueryClass
a two octet code that specifies the class of the query. For example, the QCLASS field is IN for the Internet.
Implementations§
Source§impl Question
impl Question
Sourcefn deserialise(
id: u16,
buffer: &mut ConsumableBuffer<'_>,
) -> Result<Self, Error>
fn deserialise( id: u16, buffer: &mut ConsumableBuffer<'_>, ) -> Result<Self, Error>
§Errors
If the question cannot be parsed.