pub struct Opcode(/* private fields */);
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.
Implementations§
Source§impl Opcode
impl Opcode
Sourcepub const QUERY: Opcode
pub const QUERY: Opcode
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.
Sourcepub const IQUERY: Opcode
pub const IQUERY: Opcode
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.
Sourcepub const NOTIFY: Opcode
pub const NOTIFY: Opcode
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.
Source§impl Opcode
impl Opcode
pub const COMPOSE_LEN: u16 = 1u16
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.
Sourcepub const fn to_mnemonic_str(self) -> Option<&'static str>
pub const fn to_mnemonic_str(self) -> Option<&'static str>
Returns the mnemonic as a &str
for this value if there is one
pub fn parse<'a, Octs: AsRef<[u8]> + ?Sized>( parser: &mut Parser<'a, Octs>, ) -> Result<Self, ParseError>
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 for Opcode
impl PartialOrd for Opcode
Source§impl ZonefileFmt for Opcode
impl ZonefileFmt for Opcode
Source§fn fmt(&self, p: &mut impl Formatter) -> Result
fn fmt(&self, p: &mut impl Formatter) -> Result
fmt::Formatter
Read more