#[non_exhaustive]pub enum ResourceClass {
In,
Any,
Unknown(u16),
}Expand description
DNS class. mDNS uses In (1) almost exclusively; the top bit is repurposed
per RFC 6762.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
Source§impl ResourceClass
impl ResourceClass
Sourcepub const fn is_in(&self) -> bool
pub const fn is_in(&self) -> bool
Returns true if this value is of type In. 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 ResourceClass
impl ResourceClass
Sourcepub fn unwrap_in(self)
pub fn unwrap_in(self)
Unwraps this value to the ResourceClass::In 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 ResourceClass::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 ResourceClass::Unknown variant.
Panics if this value is of any other type.
Source§impl ResourceClass
impl ResourceClass
Sourcepub fn try_unwrap_in(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_in(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the ResourceClass::In 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 ResourceClass::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 ResourceClass::Unknown variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Source§impl ResourceClass
impl ResourceClass
Sourcepub const fn from_u16(v: u16) -> Self
pub const fn from_u16(v: u16) -> Self
Reconstructs from a wire-format 16-bit class field, stripping the
top bit (cache-flush / unicast-response). Use Self::from_u16_raw
if you need to preserve the bit.
Sourcepub const fn from_u16_raw(v: u16) -> Self
pub const fn from_u16_raw(v: u16) -> Self
Reconstructs from a wire-format 16-bit class field without masking.
Trait Implementations§
Source§impl Clone for ResourceClass
impl Clone for ResourceClass
Source§fn clone(&self) -> ResourceClass
fn clone(&self) -> ResourceClass
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 ResourceClass
Source§impl Debug for ResourceClass
impl Debug for ResourceClass
Source§impl Display for ResourceClass
impl Display for ResourceClass
impl Eq for ResourceClass
Source§impl Hash for ResourceClass
impl Hash for ResourceClass
Source§impl Ord for ResourceClass
impl Ord for ResourceClass
Source§fn cmp(&self, other: &ResourceClass) -> Ordering
fn cmp(&self, other: &ResourceClass) -> 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 ResourceClass
impl PartialEq for ResourceClass
Source§fn eq(&self, other: &ResourceClass) -> bool
fn eq(&self, other: &ResourceClass) -> bool
self and other values to be equal, and is used by ==.