pub enum DNSClass {
IN,
CH,
HS,
NONE,
ANY,
OPT(u16),
Unknown(u16),
}
Expand description
The DNS Record class
Variants§
IN
Internet
CH
Chaos
HS
Hesiod
NONE
QCLASS NONE
ANY
QCLASS * (ANY)
OPT(u16)
Special class for OPT Version, it was overloaded for EDNS - RFC 6891
From the RFC: Values lower than 512 MUST be treated as equal to 512
Unknown(u16)
Unknown DNSClass was parsed
Implementations§
Trait Implementations§
Source§impl<'r> BinDecodable<'r> for DNSClass
impl<'r> BinDecodable<'r> for DNSClass
Source§fn read(decoder: &mut BinDecoder<'_>) -> Result<Self, ProtoError>
fn read(decoder: &mut BinDecoder<'_>) -> Result<Self, ProtoError>
Read the type from the stream
Source§fn from_bytes(bytes: &'r [u8]) -> Result<Self, ProtoError>
fn from_bytes(bytes: &'r [u8]) -> Result<Self, ProtoError>
Returns the object in binary form
Source§impl BinEncodable for DNSClass
impl BinEncodable for DNSClass
Source§fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>
fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>
Write the type to the stream
Source§impl<'de> Deserialize<'de> for DNSClass
impl<'de> Deserialize<'de> for DNSClass
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<DNSClass> for &'static str
impl From<DNSClass> for &'static str
Convert from DNSClass
to &str
use hickory_proto::rr::dns_class::DNSClass;
let var: &'static str = DNSClass::IN.into();
assert_eq!("IN", var);
Source§impl From<DNSClass> for u16
impl From<DNSClass> for u16
Convert from DNSClass
to u16
use hickory_proto::rr::dns_class::DNSClass;
let var: u16 = DNSClass::IN.into();
assert_eq!(1, var);
Source§impl From<u16> for DNSClass
impl From<u16> for DNSClass
Convert from u16
to DNSClass
use hickory_proto::rr::dns_class::DNSClass;
let var: DNSClass = 1u16.into();
assert_eq!(DNSClass::IN, var);
Source§impl FromStr for DNSClass
impl FromStr for DNSClass
Source§fn from_str(str: &str) -> Result<Self, ProtoError>
fn from_str(str: &str) -> Result<Self, ProtoError>
Convert from &str
to DNSClass
use std::str::FromStr;
use hickory_proto::rr::dns_class::DNSClass;
let var: DNSClass = DNSClass::from_str("IN").unwrap();
assert_eq!(DNSClass::IN, var);
Source§type Err = ProtoError
type Err = ProtoError
The associated error which can be returned from parsing.
Source§impl Ord for DNSClass
impl Ord for DNSClass
Source§impl PartialOrd for DNSClass
impl PartialOrd for DNSClass
impl Copy for DNSClass
impl Eq for DNSClass
impl StructuralPartialEq for DNSClass
Auto Trait Implementations§
impl Freeze for DNSClass
impl RefUnwindSafe for DNSClass
impl Send for DNSClass
impl Sync for DNSClass
impl Unpin for DNSClass
impl UnwindSafe for DNSClass
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.