Enum trust_dns_proto::rr::dns_class::DNSClass[][src]

pub enum DNSClass {
    IN,
    CH,
    HS,
    NONE,
    ANY,
    OPT(u16),
}

The DNS Record class

Variants

Internet

Chaos

Hesiod

QCLASS NONE

QCLASS * (ANY)

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]

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);

Return the OPT version from value

Trait Implementations

impl Debug for DNSClass
[src]

Formats the value using the given formatter. Read more

impl PartialEq for DNSClass
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for DNSClass
[src]

impl Hash for DNSClass
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Copy for DNSClass
[src]

impl Clone for DNSClass
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl FromStr for DNSClass
[src]

The associated error which can be returned from parsing.

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 BinEncodable for DNSClass
[src]

Write the type to the stream

Returns the object in binary form

impl<'r> BinDecodable<'r> for DNSClass
[src]

Read the type from the stream

Returns the object in binary form

impl From<DNSClass> for &'static str
[src]

Convert from DNSClass to &str

use trust_dns_proto::rr::dns_class::DNSClass;

let var: &'static str = DNSClass::IN.into();
assert_eq!("IN", var);

Performs the conversion.

impl From<DNSClass> for u16
[src]

Convert from DNSClass to u16

use trust_dns_proto::rr::dns_class::DNSClass;

let var: u16 = DNSClass::IN.into();
assert_eq!(1, var);

Performs the conversion.

impl PartialOrd<DNSClass> for DNSClass
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for DNSClass
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Display for DNSClass
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for DNSClass

impl Sync for DNSClass