[−][src]Module dns_message_parser::rr
This module contains struct for resource records handling.
The RR
enum represents an arbitrary resource record. Each type has a dedicated struct,
which has a variant in the RR
enum. For example, the A
struct represent an A record.
The Class
enum represents the class field of the resource record.
The Type
enum represents the type field of the resource record.
Yet there are some missing resource records and types
Example
use dns_message_parser::rr::{RR, A}; use std::convert::TryInto; // Init A record let a = A { // The domain name of the A record domain_name: "example.org".try_into().unwrap(), // The time to live of the A record ttl: 1000, // The address of the A record ipv4_addr: "10.0.0.1".parse().unwrap(), }; // Convert the resource record into a RR let rr = RR::A(a); // Encode the A record into bytes::BytesMut let bytes = rr.encode().unwrap(); // Decode the A record into a RR enum let rr = RR::decode(bytes.freeze()).unwrap();
Modules
edns |
Structs
A | The IPv4 host address resource record type. |
AAAA | The IPv6 host address resource record type. |
AFSDB | The AFS Data base location resource record type: |
APItem | |
APL | |
CNAME | The canonical name resource record type. |
DNAME | |
EID | |
EUI48 | |
EUI64 | |
GPOS | The geographical location resource record type. |
HINFO | The host information resource record type. |
ISDN | The ISDN resource record type. |
ISDNAddress | |
KX | The key exchange resource record type. |
L32 | |
L64 | |
LOC | The location information resource record type. |
LP | |
MB | The mailbox domain name resource record type. |
MD | The mail destination resource record type. (obsolete) |
MF | The mail forwarder resource record type. (obsolete) |
MG | The mail group member resource record type. |
MINFO | The mailbox or mail list information resource record type. |
MR | The mail rename domain name resource record type. |
MX | The mail exchange resource record type. |
NID | |
NIMLOC | |
NS | The authoritative name server resource record type. |
NSAP | The NSAP resource record type. |
NULL | The null type. |
OPT | |
PSDNAddress | |
PTR | The domain name pointer resource record type. |
PX | The X.400 pointer resource record type. |
RP | The responsible person resource record type. |
RT | The route through resource record type. |
SA | |
SOA | The start of a zone of authority resource record type. |
SRV | The location of services resource record type. |
SSHFP | |
TXT | The text resource record type. |
URI | |
WKS | The well known service description resource record type. |
X25 |
Enums
AFSDBSubtype | |
Address | |
AddressError | |
AddressFamilyNumber | |
Class | The class field in the resource records. |
ISDNError | |
RR | |
SSHFPAlgorithm | |
SSHFPType | |
Type | The type field in the resource records. |
X25Error | The X25 resource record type. |
Constants
APL_NEGATION_MASK |
Traits
ToType |