Enum domain::base::iana::rcode::Rcode

source ·
pub enum Rcode {
    NoError,
    FormErr,
    ServFail,
    NXDomain,
    NotImp,
    Refused,
    YXDomain,
    YXRRSet,
    NXRRSet,
    NotAuth,
    NotZone,
    Int(u8),
}
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.

Variants§

§

NoError

No error condition.

(Otherwise known as success.)

Defined in RFC 1035.

§

FormErr

Format error.

The name server was unable to interpret the query.

Defined in RFC 1035.

§

ServFail

Server failure.

The name server was unable to process this query due to a problem with the name server.

Defined in RFC 1035.

§

NXDomain

Name error.

The domain name given in the query does not exist at the name server.

Defined in RFC 1035.

§

NotImp

Not implemented.

The name server does not support the requested kind of query.

Defined in RFC 1035.

§

Refused

Query refused.

The name server refused to perform the operation requested by the query for policy reasons.

Defined in RFC 1035.

§

YXDomain

Name exists when it should not.

Returned for an UPDATE query when a domain requested to not exist does in fact exist.

Returned when resolving a DNAME redirection when the resulting name exceeds the length of 255 octets.

Defined in RFC 2136 for the UPDATE query and RFC 6672 for DNAME redirection.

§

YXRRSet

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.

§

NXRRSet

RR set that should exist does not.

Returned for an UPDATE query when an RRset requested to exist does not.

Defined in RFC 2136.

§

NotAuth

Server not authoritative for zone or client not authorized.

Returned for an UPDATE query when the server is not an authoritative name server for the requested domain.

Returned for queries using TSIG when authorisation failed.

Defined in RFC 2136 for UPDATE and RFC 2845 for TSIG.

§

NotZone

Name not contained in zone.

A name used in the prerequisite or update section is not within the zone given in the zone section.

Defined in RFC 2136.

§

Int(u8)

A raw, integer rcode value.

When converting to an u8, only the lower four bits are used.

Implementations§

source§

impl Rcode

source

pub fn from_int(value: u8) -> Rcode

Creates an rcode from an integer.

Only the lower four bits of value are considered.

source

pub fn to_int(self) -> u8

Returns the integer value for this rcode.

Trait Implementations§

source§

impl Clone for Rcode

source§

fn clone(&self) -> Rcode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Rcode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Rcode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Rcode> for OptRcode

source§

fn from(value: Rcode) -> OptRcode

Converts to this type from the input type.
source§

impl From<Rcode> for TsigRcode

source§

fn from(value: Rcode) -> TsigRcode

Converts to this type from the input type.
source§

impl From<Rcode> for u8

source§

fn from(value: Rcode) -> u8

Converts to this type from the input type.
source§

impl From<u8> for Rcode

source§

fn from(value: u8) -> Rcode

Converts to this type from the input type.
source§

impl Hash for Rcode

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Rcode

source§

fn cmp(&self, other: &Rcode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Rcode> for Rcode

source§

fn eq(&self, other: &Rcode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Rcode> for u8

source§

fn eq(&self, other: &Rcode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<u8> for Rcode

source§

fn eq(&self, other: &u8) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Rcode> for Rcode

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<Rcode> for u8

source§

fn partial_cmp(&self, other: &Rcode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd<u8> for Rcode

source§

fn partial_cmp(&self, other: &u8) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Rcode

source§

impl Eq for Rcode

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Source, Target> OctetsInto<Target> for Sourcewhere Target: OctetsFrom<Source>,

§

type Error = <Target as OctetsFrom<Source>>::Error

source§

fn try_octets_into( self ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
source§

fn octets_into(self) -> Targetwhere Self::Error: Into<Infallible>,

Performs an infallible conversion.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V