pub struct Rcode(/* private fields */);
Expand description
DNS Response Codes.
The response code of a response indicates what happend on the server when trying to answer the query. The code is a 4 bit value and part of the header of a DNS message.
This response was defined as part of RFC 1035. Later, RFC 2671 defined an extended response code of 12 bits using the lower four bits from the header and eight additional bits stored in the OPT pseudo-record. The type OptRcode represents this extended response code. A third response code, now 16 bit wide, was defined for the transaction authentication mechansim (TSIG) in [RFC 2845] and is represented by TsigRcode.
All three codes share the same name space. Their values are defined in one registry, IANA DNS RCODEs. This type is complete as of 2019-01-28.
Implementations§
source§impl Rcode
impl Rcode
sourcepub const SERVFAIL: Self = _
pub const SERVFAIL: Self = _
Server failure.
The name server was unable to process this query due to a problem with the name server.
Defined in RFC 1035.
sourcepub const NXDOMAIN: Self = _
pub const NXDOMAIN: Self = _
Name error.
The domain name given in the query does not exist at the name server.
Defined in RFC 1035.
sourcepub const REFUSED: Self = _
pub const REFUSED: Self = _
Query refused.
The name server refused to perform the operation requested by the query for policy reasons.
Defined in RFC 1035.
sourcepub const YXRRSET: Self = _
pub const YXRRSET: Self = _
RR set exists when it should not.
Returned for an UPDATE query when an RRset requested to not exist does in fact exist.
Defined in RFC 2136.
sourcepub const NXRRSET: Self = _
pub const NXRRSET: Self = _
RR set that should exist does not.
Returned for an UPDATE query when an RRset requested to exist does not.
Defined in RFC 2136.
source§impl Rcode
impl Rcode
sourcepub const fn checked_from_int(value: u8) -> Option<Self>
pub const fn checked_from_int(value: u8) -> Option<Self>
Creates an rcode from an integer, returning None
if invalid.
The rcode is valid if the upper four bits of value
are all zero.
sourcepub const fn masked_from_int(value: u8) -> Self
pub const fn masked_from_int(value: u8) -> Self
Creates an rcode from an integer, only considering the lower four bits.
This function will ignore the upper four bit of value
.
sourcepub const fn to_int(self) -> u8
pub const fn to_int(self) -> u8
Returns the integer value for this rcode.
Only the lower 4 bits of the returned octet are used by the rcode. The upper four bits are always zero.
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.
Trait Implementations§
source§impl Ord for Rcode
impl Ord for Rcode
source§impl PartialOrd for Rcode
impl PartialOrd for Rcode
impl Copy for Rcode
impl Eq for Rcode
impl StructuralPartialEq for Rcode
Auto Trait Implementations§
impl Freeze for Rcode
impl RefUnwindSafe for Rcode
impl Send for Rcode
impl Sync for Rcode
impl Unpin for Rcode
impl UnwindSafe for Rcode
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
)