pub enum Opcode {
Query,
IQuery,
Status,
Notify,
Update,
Dso,
Int(u8),
}
Expand description
DNS OpCodes.
The opcode specifies the kind of query to be performed.
The opcode and its initial set of values are defined in RFC 1035. Additional values have been defined over time. All currently assigned values can be found in the IANA registry. This type is complete as of 2019-12-23.
Variants§
Query
A standard query (0).
This query requests all records matching the name, class, and record type given in the query’s question section.
This value is defined in RFC 1035.
IQuery
An inverse query (IQUERY) (1, obsolete).
The idea behind inverse queries was to provide a single answer and ask the DNS for all the questions that would lead to this answer. This kind of query has always been optional, was never widely supported, and has therefore been declared obsolete.
This value was defined in RFC 1035 and obsoleted by RFC 3425.
Status
A server status request (2).
This value is defined in RFC 1035. The status request itself was defined as experimental and ‘to be defined’ in RFC 1034 and seems to never have been mentioned ever again.
Notify
A NOTIFY query (4).
NOTIFY queries allow primary servers to inform secondary servers when a zone has changed.
This value and the NOTIFY query are defined in RFC 1996.
Update
An UPDATE query (5).
The UPDATE query can be used to alter zone content managed by an authoritative server.
This value and the UPDATE query are defined in RFC 2136.
Dso
DNS Stateful operations (DSO) (6).
The DSO query can be used to manage stateful sessions between two DNS endpoints.
This value and the DOS query are defined in RFC 8490.
Int(u8)
A raw value given through its integer.
Implementations§
source§impl Opcode
impl Opcode
sourcepub fn from_mnemonic(m: &[u8]) -> Option<Self>
pub fn from_mnemonic(m: &[u8]) -> Option<Self>
Returns a value from a well-defined mnemonic.
sourcepub const fn to_mnemonic(self) -> Option<&'static [u8]>
pub const fn to_mnemonic(self) -> Option<&'static [u8]>
Returns the mnemonic for this value if there is one.
This will also return a mnemonic if a well-defined variant
is hidden in a Int
variant.
pub fn parse<'a, Octs: AsRef<[u8]> + ?Sized>( parser: &mut Parser<'a, Octs>, ) -> Result<Self, ParseError>
pub const COMPOSE_LEN: u16 = 1u16
pub fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
Trait Implementations§
source§impl Ord for Opcode
impl Ord for Opcode
source§impl PartialOrd<Opcode> for u8
impl PartialOrd<Opcode> for u8
source§impl PartialOrd<u8> for Opcode
impl PartialOrd<u8> for Opcode
source§impl PartialOrd for Opcode
impl PartialOrd for Opcode
impl Copy for Opcode
impl Eq for Opcode
Auto Trait Implementations§
impl Freeze for Opcode
impl RefUnwindSafe for Opcode
impl Send for Opcode
impl Sync for Opcode
impl Unpin for Opcode
impl UnwindSafe for Opcode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)