domain/base/iana/
mod.rs

1//! IANA Definitions for DNS.
2//!
3//! This module contains enums for parameters defined in IANA registries
4//! that are relevant for this crate.
5//!
6//! All types defined hereunder follow the same basic structure. They are
7//! all enums with all well-defined values as variants. In addition they
8//! have an `Int` variant that contains a raw integer value. Since we cannot
9//! restrict that integer to only the undefined values, we generally allow
10//! the full set of possible values. We treat this correctly, meaning that
11//! the well-defined variant and the `Int` variant with the same integer
12//! value compare to equal.
13//!
14//! There are two methods `from_int()` and `to_int()` to convert from and
15//! to raw integer values as well as implementations of the `From` trait
16//! for these. `FromStr` and `Display` are implemented to convert from
17//! the string codes to the values and back. All of these are essentially
18//! giant matches which may or may not be the smartest way to do this.
19//!
20//! Types also implement `parse()` and `scan()` functions for creation from
21//! wire format and representation format, respectively, as well as a
22//! `compose()` method for composing into wire format data.
23//!
24//! While each parameter type has a module of its own, they are all
25//! re-exported here. This is mostly so we can have associated types like
26//! `FromStrError` without having to resort to devilishly long names.
27
28pub use self::class::Class;
29pub use self::digestalg::DigestAlg;
30pub use self::exterr::ExtendedErrorCode;
31pub use self::nsec3::Nsec3HashAlg;
32pub use self::opcode::Opcode;
33pub use self::opt::OptionCode;
34pub use self::rcode::{OptRcode, Rcode, TsigRcode};
35pub use self::rtype::Rtype;
36pub use self::secalg::SecAlg;
37pub use self::svcb::SvcParamKey;
38
39#[macro_use]
40mod macros;
41
42pub mod class;
43pub mod digestalg;
44pub mod exterr;
45pub mod nsec3;
46pub mod opcode;
47pub mod opt;
48pub mod rcode;
49pub mod rtype;
50pub mod secalg;
51pub mod svcb;