pub enum DNSClass {
IN,
CH,
HS,
NONE,
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
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
Write the type to the stream
Returns the object in binary form
Read the type from the stream
Returns the object in binary form
Convert from DNSClass to &str
use trust_dns_proto::rr::dns_class::DNSClass;
let var: &'static str = DNSClass::IN.into();
assert_eq!("IN", var);
Convert from DNSClass to u16
use trust_dns_proto::rr::dns_class::DNSClass;
let var: u16 = DNSClass::IN.into();
assert_eq!(1, var);
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
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
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);
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String
. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static