pub struct Question<'a> {
pub name: Name<'a>,
pub qtype: QType,
pub class: Class,
}
Expand description
A query for a ResourceRecord of the specified QType and Class.
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| |
/ QNAME /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QTYPE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QCLASS |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
Fields§
§name: Name<'a>
The domain name to be queried
qtype: QType
The type of ResourceRecord being queried
class: Class
The class of ResourceRecord being queried
Implementations§
source§impl<'a> Question<'a>
impl<'a> Question<'a>
sourcepub fn parse(
buff: &'a [u8],
start: usize
) -> Result<(Question<'a>, usize), ParseError>
pub fn parse(
buff: &'a [u8],
start: usize
) -> Result<(Question<'a>, usize), ParseError>
Parse from the specified buff
, starting at position start
.
Errors
It will error if the buffer does not contain a valid question. If the domain name in the question has been compressed the buffer should include all previous bytes from the DNS packet to be considered valid.