pub enum Class {
In,
Ch,
Hs,
None,
Any,
Int(u16),
}
Expand description
DNS CLASSes.
The domain name space is partitioned into separate classes for different network types. That is, each class has its own separate record tree starting at the root. However, in practice, only the IN class is really relevant.
In addition, there are query classes or QCLASSes that are used in questions or UPDATE queries, namely NONE and ANY (or *).
Classes are represented by a 16 bit value. The enum wraps these values.
See RFC 1034 for the introduction of classes, section 3.2 of RFC 6895 for a discussion of the current state of afairs, and the DNS CLASSes IANA registry for an overview of assigned values. This type is complete as of the registry update of 2019-01-28.
Variants§
In
Internet (IN).
This class is defined in RFC 1035 and really the only one relevant at all.
Ch
Chaosnet (CH).
A network protocol developed at MIT in the 1970s. Reused by BIND for built-in server information zones.“,
Hs
Hesiod (HS).
A system information protocol part of MIT’s Project Athena.“,
None
Query class None.
Defined in RFC 2136, this class is used in UPDATE queries to require that an RRset does not exist prior to the update.“,
Any
Query class * (ANY).
This class can be used in a query to indicate that records for the given name from any class are requested.“,
Int(u16)
A raw value given through its integer.
Implementations§
source§impl Class
impl Class
sourcepub fn from_mnemonic(m: &[u8]) -> Option<Self>
pub fn from_mnemonic(m: &[u8]) -> Option<Self>
Returns a value from a well-defined mnemonic.
sourcepub const fn to_mnemonic(self) -> Option<&'static [u8]>
pub const fn to_mnemonic(self) -> Option<&'static [u8]>
Returns the mnemonic for this value if there is one.
This will also return a mnemonic if a well-defined variant
is hidden in a Int
variant.
pub fn parse<'a, Octs: AsRef<[u8]> + ?Sized>( parser: &mut Parser<'a, Octs> ) -> Result<Self, ParseError>
pub const COMPOSE_LEN: u16 = 2u16
pub fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target ) -> Result<(), Target::AppendError>
Trait Implementations§
source§impl Ord for Class
impl Ord for Class
source§impl PartialEq<Class> for Class
impl PartialEq<Class> for Class
source§impl PartialEq<Class> for u16
impl PartialEq<Class> for u16
source§impl PartialOrd<Class> for Class
impl PartialOrd<Class> for Class
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd<Class> for u16
impl PartialOrd<Class> for u16
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd<u16> for Class
impl PartialOrd<u16> for Class
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more