Enum trust_dns::rr::DNSClass
[−]
[src]
pub enum DNSClass { IN, CH, HS, NONE, ANY, OPT(u16), }
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
Methods
impl DNSClass
[src]
fn from_u16(value: u16) -> Result<DNSClass, ProtoError>
[src]
Convert from u16 to DNSClass
use trust_dns_proto::rr::dns_class::DNSClass; let var = DNSClass::from_u16(1).unwrap(); assert_eq!(DNSClass::IN, var);
fn for_opt(value: u16) -> DNSClass
[src]
Return the OPT version from value
Trait Implementations
impl Ord for DNSClass
[src]
impl Hash for DNSClass
[src]
impl Copy for DNSClass
[src]
impl Clone for DNSClass
[src]
fn clone(&self) -> DNSClass
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for DNSClass
[src]
impl PartialEq<DNSClass> for DNSClass
[src]
fn eq(&self, __arg_0: &DNSClass) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &DNSClass) -> bool
[src]
This method tests for !=
.
impl FromStr for DNSClass
[src]
type Err = ProtoError
The associated error which can be returned from parsing.
fn from_str(str: &str) -> Result<DNSClass, ProtoError>
[src]
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);
impl Debug for DNSClass
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl BinSerializable<DNSClass> for DNSClass
[src]
fn read(decoder: &mut BinDecoder) -> Result<DNSClass, ProtoError>
[src]
Read the type from the stream
fn emit(&self, encoder: &mut BinEncoder) -> Result<(), ProtoError>
[src]
Write the type to the stream
impl Display for DNSClass
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more