Enum trust_dns_proto::rr::dns_class::DNSClass
source · pub enum DNSClass {
IN,
CH,
HS,
NONE,
ANY,
OPT(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
Implementations
Trait Implementations
sourceimpl<'r> BinDecodable<'r> for DNSClass
impl<'r> BinDecodable<'r> for DNSClass
sourcefn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
Read the type from the stream
sourcefn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
Returns the object in binary form
sourceimpl BinEncodable for DNSClass
impl BinEncodable for DNSClass
sourcefn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
Write the type to the stream
sourcefn to_bytes(&self) -> ProtoResult<Vec<u8>>
fn to_bytes(&self) -> ProtoResult<Vec<u8>>
Returns the object in binary form
sourceimpl From<DNSClass> for &'static str
impl From<DNSClass> for &'static str
Convert from DNSClass to &str
use trust_dns_proto::rr::dns_class::DNSClass;
let var: &'static str = DNSClass::IN.into();
assert_eq!("IN", var);
sourceimpl From<DNSClass> for u16
impl From<DNSClass> for u16
Convert from DNSClass to u16
use trust_dns_proto::rr::dns_class::DNSClass;
let var: u16 = DNSClass::IN.into();
assert_eq!(1, var);
sourceimpl FromStr for DNSClass
impl FromStr for DNSClass
sourcefn from_str(str: &str) -> ProtoResult<Self>
fn from_str(str: &str) -> ProtoResult<Self>
Convert from &str
to DNSClass
use std::str::FromStr;
use trust_dns_proto::rr::dns_class::DNSClass;
let var: DNSClass = DNSClass::from_str("IN").unwrap();
assert_eq!(DNSClass::IN, var);
type Err = ProtoError
type Err = ProtoError
The associated error which can be returned from parsing.
sourceimpl Ord for DNSClass
impl Ord for DNSClass
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<DNSClass> for DNSClass
impl PartialOrd<DNSClass> for DNSClass
sourcefn partial_cmp(&self, other: &DNSClass) -> Option<Ordering>
fn partial_cmp(&self, other: &DNSClass) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for DNSClass
impl Eq for DNSClass
impl StructuralEq for DNSClass
impl StructuralPartialEq for DNSClass
Auto Trait Implementations
impl RefUnwindSafe for DNSClass
impl Send for DNSClass
impl Sync for DNSClass
impl Unpin for DNSClass
impl UnwindSafe for DNSClass
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more