#[non_exhaustive]pub enum Opcode {
Query,
InverseQuery,
Status,
Notify,
Update,
Unknown(u8),
}Expand description
DNS message opcode. mDNS requires Opcode::Query (0); other values are
kept for round-trip correctness against non-conforming traffic.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Query
Standard query (0).
InverseQuery
Inverse query (1, obsoleted by RFC 3425).
Status
Server status request (2).
Notify
Notify (4, RFC 1996).
Update
Dynamic update (5, RFC 2136).
Unknown(u8)
Lossless escape for unknown opcodes encountered on the wire.
Implementations§
Source§impl Opcode
impl Opcode
Sourcepub const fn is_query(&self) -> bool
pub const fn is_query(&self) -> bool
Returns true if this value is of type Query. Returns false otherwise
Sourcepub const fn is_inverse_query(&self) -> bool
pub const fn is_inverse_query(&self) -> bool
Returns true if this value is of type InverseQuery. Returns false otherwise
Sourcepub const fn is_status(&self) -> bool
pub const fn is_status(&self) -> bool
Returns true if this value is of type Status. Returns false otherwise
Sourcepub const fn is_notify(&self) -> bool
pub const fn is_notify(&self) -> bool
Returns true if this value is of type Notify. Returns false otherwise
Sourcepub const fn is_update(&self) -> bool
pub const fn is_update(&self) -> bool
Returns true if this value is of type Update. 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 Opcode
impl Opcode
Sourcepub fn unwrap_query(self)
pub fn unwrap_query(self)
Unwraps this value to the Opcode::Query variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_inverse_query(self)
pub fn unwrap_inverse_query(self)
Unwraps this value to the Opcode::InverseQuery variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_status(self)
pub fn unwrap_status(self)
Unwraps this value to the Opcode::Status variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_notify(self)
pub fn unwrap_notify(self)
Unwraps this value to the Opcode::Notify variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_update(self)
pub fn unwrap_update(self)
Unwraps this value to the Opcode::Update variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_unknown(self) -> u8
pub fn unwrap_unknown(self) -> u8
Unwraps this value to the Opcode::Unknown variant.
Panics if this value is of any other type.
Source§impl Opcode
impl Opcode
Sourcepub fn try_unwrap_query(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_query(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the Opcode::Query variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_inverse_query(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_inverse_query(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the Opcode::InverseQuery variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_status(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_status(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the Opcode::Status variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_notify(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_notify(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the Opcode::Notify variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_update(self) -> Result<(), TryUnwrapError<Self>>
pub fn try_unwrap_update(self) -> Result<(), TryUnwrapError<Self>>
Attempts to unwrap this value to the Opcode::Update variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.
Sourcepub fn try_unwrap_unknown(self) -> Result<u8, TryUnwrapError<Self>>
pub fn try_unwrap_unknown(self) -> Result<u8, TryUnwrapError<Self>>
Attempts to unwrap this value to the Opcode::Unknown variant.
Returns a [TryUnwrapError] with the original value if this value is of any other type.