#[non_exhaustive]pub enum ResourceType {
A,
AAAA,
Ptr,
Srv,
Txt,
Nsec,
Hinfo,
Cname,
Any,
Unknown(u16),
}Expand description
Resource record type code.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
A
IPv4 address (1).
AAAA
IPv6 address (28).
Ptr
Domain name pointer (12).
Srv
Server location (33).
Txt
Text record (16).
Nsec
Next secure (47, used for negative responses in RFC 6762 §6.1).
Hinfo
Host info (13, rarely used).
Cname
Canonical name alias (5).
Any
Wildcard query type (255).
Unknown(u16)
Lossless escape for unknown rtypes.
Implementations§
Source§impl ResourceType
impl ResourceType
Sourcepub const fn is_a(&self) -> bool
pub const fn is_a(&self) -> bool
Returns true if this value is of type A. Returns false otherwise
Sourcepub const fn is_aaaa(&self) -> bool
pub const fn is_aaaa(&self) -> bool
Returns true if this value is of type AAAA. Returns false otherwise
Sourcepub const fn is_ptr(&self) -> bool
pub const fn is_ptr(&self) -> bool
Returns true if this value is of type Ptr. Returns false otherwise
Sourcepub const fn is_srv(&self) -> bool
pub const fn is_srv(&self) -> bool
Returns true if this value is of type Srv. Returns false otherwise
Sourcepub const fn is_txt(&self) -> bool
pub const fn is_txt(&self) -> bool
Returns true if this value is of type Txt. Returns false otherwise
Sourcepub const fn is_nsec(&self) -> bool
pub const fn is_nsec(&self) -> bool
Returns true if this value is of type Nsec. Returns false otherwise
Sourcepub const fn is_hinfo(&self) -> bool
pub const fn is_hinfo(&self) -> bool
Returns true if this value is of type Hinfo. Returns false otherwise
Sourcepub const fn is_cname(&self) -> bool
pub const fn is_cname(&self) -> bool
Returns true if this value is of type Cname. Returns false otherwise
Sourcepub const fn is_any(&self) -> bool
pub const fn is_any(&self) -> bool
Returns true if this value is of type Any. Returns false otherwise
Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true if this value is of type Unknown. Returns false otherwise
Source§impl ResourceType
impl ResourceType
Sourcepub fn unwrap_a(self)
pub fn unwrap_a(self)
Unwraps this value to the ResourceType::A variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_aaaa(self)
pub fn unwrap_aaaa(self)
Unwraps this value to the ResourceType::AAAA variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_ptr(self)
pub fn unwrap_ptr(self)
Unwraps this value to the ResourceType::Ptr variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_srv(self)
pub fn unwrap_srv(self)
Unwraps this value to the ResourceType::Srv variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_txt(self)
pub fn unwrap_txt(self)
Unwraps this value to the ResourceType::Txt variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_nsec(self)
pub fn unwrap_nsec(self)
Unwraps this value to the ResourceType::Nsec variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_hinfo(self)
pub fn unwrap_hinfo(self)
Unwraps this value to the ResourceType::Hinfo variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_cname(self)
pub fn unwrap_cname(self)
Unwraps this value to the ResourceType::Cname variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_any(self)
pub fn unwrap_any(self)
Unwraps this value to the ResourceType::Any variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_unknown(self) -> u16
pub fn unwrap_unknown(self) -> u16
Unwraps this value to the ResourceType::Unknown variant.
Panics if this value is of any other type.
Source§impl ResourceType
impl ResourceType
Sourcepub fn try_unwrap_a(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_a(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceType::A variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_aaaa(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_aaaa(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceType::AAAA variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_ptr(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_ptr(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceType::Ptr variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_srv(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_srv(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceType::Srv variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_txt(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_txt(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceType::Txt variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_nsec(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_nsec(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceType::Nsec variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_hinfo(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_hinfo(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceType::Hinfo variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_cname(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_cname(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceType::Cname variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_any(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_any(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceType::Any variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_unknown(self) -> Result<u16, TryUnwrapError<Self>>
pub fn try_unwrap_unknown(self) -> Result<u16, TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceType::Unknown variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Source§impl ResourceType
impl ResourceType
Trait Implementations§
Source§impl Clone for ResourceType
impl Clone for ResourceType
Source§fn clone(&self) -> ResourceType
fn clone(&self) -> ResourceType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ResourceType
Source§impl Debug for ResourceType
impl Debug for ResourceType
Source§impl Display for ResourceType
impl Display for ResourceType
impl Eq for ResourceType
Source§impl Hash for ResourceType
impl Hash for ResourceType
Source§impl Ord for ResourceType
impl Ord for ResourceType
Source§fn cmp(&self, other: &ResourceType) -> Ordering
fn cmp(&self, other: &ResourceType) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ResourceType
impl PartialEq for ResourceType
Source§fn eq(&self, other: &ResourceType) -> bool
fn eq(&self, other: &ResourceType) -> bool
self and other values to be equal, and is used by ==.