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
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 for Opcode
impl PartialOrd for Opcode
impl Copy for Opcode
impl Eq for Opcode
impl StructuralPartialEq 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)