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 PartialOrd<Class> for u16
impl PartialOrd<Class> for u16
source§impl PartialOrd<u16> for Class
impl PartialOrd<u16> for Class
source§impl PartialOrd for Class
impl PartialOrd for Class
impl Copy for Class
impl Eq for Class
Auto Trait Implementations§
impl Freeze for Class
impl RefUnwindSafe for Class
impl Send for Class
impl Sync for Class
impl Unpin for Class
impl UnwindSafe for Class
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)