domain_core/rdata/
mod.rs

1//! Resource data implementations.
2//!
3//! This module will eventually contain implementations for the record data
4//! for all defined resource record types.
5//!
6//! The types are named identically to the [`Rtype`] variant they implement.
7//! They are grouped into submodules for the RFCs they are defined in. All
8//! types are also re-exported at the top level here. Ie., for the AAAA
9//! record type, you can simple `use domain::rdata::Aaaa` instead of
10//! `use domain::rdata::rfc3596::Aaaa` which nobody could possibly remember.
11//! There are, however, some helper data types defined here and there which
12//! are not re-exported to keep things somewhat tidy.
13//!
14//! See the [`Rtype`] enum for the complete set of record types and,
15//! consequently, those types that are still missing.
16//!
17//! [`Rtype`]: ../iana/enum.Rtype.html
18
19pub mod rfc1035;
20pub mod rfc2782;
21pub mod rfc3596;
22pub mod rfc4034;
23pub mod rfc5155;
24
25#[macro_use] mod macros;
26use crate::bits::opt::Opt;
27
28// The rdata_types! macro (defined in self::macros) reexports the record data
29// types here and creates the MasterRecordData and AllRecordData enums
30// containing all record types that can appear in master files or all record
31// types that exist.
32//
33// All record data types listed here should have the same name as the
34// `Rtype` variant they implement.
35//
36// Add any new module here and then add all record types in that module that
37// can appear in master files under "master" and all others under "pseudo".
38// In both cases, if your type is generic over a domain name type, add `<N>`
39// to it (it can’t be over anything else, so if you have more type arguments,
40// you might have to either newtype with those removes or, God forbid, modify
41// the macro). Each type entry has to be followed by a comma, even the last
42// one.
43rdata_types!{
44    rfc1035::{
45        master {
46            A,
47            Cname<N>,
48            Hinfo,
49            Mb<N>,
50            Md<N>,
51            Mf<N>,
52            Minfo<N>,
53            Mr<N>,
54            Mx<N>,
55            Ns<N>,
56            Ptr<N>,
57            Soa<N>,
58            Txt,
59            Wks,
60        }
61        pseudo {
62            Null,
63        }
64    }
65    rfc2782::{
66        master {
67            Srv<N>,
68        }
69    }
70    rfc3596::{
71        master {
72            Aaaa,
73        }
74    }
75    rfc4034::{
76        master {
77            Dnskey,
78            Rrsig,
79            Nsec,
80            Ds,
81        }
82    }
83    rfc5155::{
84        master {
85            Nsec3,
86            Nsec3param,
87        }
88    }
89}
90
91
92pub mod parsed {
93    pub use super::rfc1035::parsed::*;
94    pub use super::rfc2782::parsed::*;
95    pub use super::rfc3596::parsed::*;
96    pub use super::rfc4034::parsed::*;
97    pub use super::rfc5155::parsed::*;
98}