Module types

Source

Structs§

DomainName
A domain name is a sequence of labels, where each label is a length octet followed by that number of octets.
Header
Common header type for all messages.
Label
A label is just a sequence of octets, which are compared as case-insensitive ASCII. A label can be no longer than 63 octets.
Message
Basic DNS message format, used for both queries and responses.
OpcodeReserved
A struct with a private constructor, to ensure invalid Opcodes cannot be created.
Question
The question section has a list of questions (usually 1 but possibly more) being asked. This is the structure for a single question.
RcodeReserved
A struct with a private constructor, to ensure invalid Rcodes cannot be created.
RecordClassUnknown
A struct with a private constructor, to ensure invalid RecordClasses cannot be created.
RecordTypeUnknown
A struct with a private constructor, to ensure invalid RecordTypes cannot be created.
ResourceRecord
The answer, authority, and additional sections are all the same format: a variable number of resource records. This is the structure for a single resource record.

Enums§

DomainNameFromStr
Errors that can arise when converting a &str into a DomainName.
LabelTryFromOctetsError
Errors that can arise when converting a [u8] into a Label.
Opcode
What sort of query this is.
QueryClass
Query classes are a superset of record classes.
QueryType
Query types are a superset of record types.
Rcode
What sort of response this is.
RecordClass
Record classes are used by resource records and by queries.
RecordClassFromStr
Errors that can arise when converting a &str into a RecordClass.
RecordType
Record types are used by resource records and by queries.
RecordTypeFromStr
Errors that can arise when converting a &str into a RecordType.
RecordTypeWithData
A record type with its associated, deserialised, data.

Constants§

DOMAINNAME_MAX_LEN
Maximum encoded length of a domain name. The number of labels plus sum of the lengths of the labels.
HEADER_MASK_AA
Octet mask for the AA flag being set (authoritative)
HEADER_MASK_OPCODE
Octet mask for the opcode field.
HEADER_MASK_QR
Octet mask for the QR flag being set (response).
HEADER_MASK_RA
Octet mask for the RA flag being set (available)
HEADER_MASK_RCODE
Octet mask for the rcode field.
HEADER_MASK_RD
Octet mask for the RD flag being set (desired)
HEADER_MASK_TC
Octet mask for the TC flag being set (truncated)
HEADER_OFFSET_OPCODE
Offset for the opcode field.
HEADER_OFFSET_RCODE
Offset for the rcode field.
LABEL_MAX_LEN
Maximum length of a single label in a domain name.