[][src]Enum trust_dns_proto::op::response_code::ResponseCode

pub enum ResponseCode {
    NoError,
    FormErr,
    ServFail,
    NXDomain,
    NotImp,
    Refused,
    YXDomain,
    YXRRSet,
    NXRRSet,
    NotAuth,
    NotZone,
    BADVERS,
    BADSIG,
    BADKEY,
    BADTIME,
    BADMODE,
    BADNAME,
    BADALG,
    BADTRUNC,
    BADCOOKIE,
}

The status code of the response to a query.

RFC 1035, DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION, November 1987

RCODE           Response code - this 4 bit field is set as part of
                responses.  The values have the following
                interpretation:

                0               No error condition

                1               Format error - The name server was
                                unable to interpret the query.

                2               Server failure - The name server was
                                unable to process this query due to a
                                problem with the name server.

                3               Name Error - Meaningful only for
                                responses from an authoritative name
                                server, this code signifies that the
                                domain name referenced in the query does
                                not exist.

                4               Not Implemented - The name server does
                                not support the requested kind of query.

                5               Refused - The name server refuses to
                                perform the specified operation for
                                policy reasons.  For example, a name
                                server may not wish to provide the
                                information to the particular requester,
                                or a name server may not wish to perform
                                a particular operation (e.g., zone
                                transfer) for particular data.

                6-15            Reserved for future use.

Variants

NoError

No Error RFC 1035

FormErr

Format Error RFC 1035

ServFail

Server Failure RFC 1035

NXDomain

Non-Esistent Domain RFC 1035

NotImp

Not Implemented RFC 1035

Refused

Query Refused RFC 1035

YXDomain

Name Exists when it should not RFC 2136

YXRRSet

RR Set Exists when it should not RFC 2136

NXRRSet

RR Set that should exist does not RFC 2136

NotAuth

Server Not Authoritative for zone RFC 2136 or Not Authorized RFC 2845

NotZone

Name not contained in zone RFC 2136

BADVERS

Bad OPT Version RFC 6891

BADSIG

TSIG Signature Failure RFC 2845

BADKEY

Key not recognized RFC 2845

BADTIME

Signature out of time window RFC 2845

BADMODE

Bad TKEY Mode RFC 2930

BADNAME

Duplicate key name RFC 2930

BADALG

Algorithm not supported RFC 2930

BADTRUNC

Bad Truncation RFC 4635

BADCOOKIE

Bad/missing server cookie draft-ietf-dnsop-cookies

Methods

impl ResponseCode
[src]

pub fn low(&self) -> u8
[src]

returns the lower 4 bits of the response code (for the original header portion of the code)

pub fn high(&self) -> u16
[src]

returns the high 12 bits for the edns portion of the response code

pub fn from(high: u8, low: u8) -> ResponseCode
[src]

Combines the EDNS high and low from the Header to produce the Extended ResponseCode

pub fn to_str(&self) -> &'static str
[src]

Transforms the response code into the human message

Trait Implementations

impl From<ResponseCode> for u16
[src]

Convert from ResponseCode to u16

use std::convert::From;
use trust_dns_proto::op::response_code::ResponseCode;

let var: ResponseCode = From::from(0);
assert_eq!(ResponseCode::NoError, var);

let var: ResponseCode = 0.into();
assert_eq!(ResponseCode::NoError, var);

impl From<u16> for ResponseCode
[src]

Convert from u16 to ResponseCode

use std::convert::From;
use trust_dns_proto::op::response_code::ResponseCode;

let var: u16 = From::from(ResponseCode::NoError);
assert_eq!(0, var);

let var: u16 = ResponseCode::NoError.into();
assert_eq!(0, var);

impl PartialOrd<ResponseCode> for ResponseCode
[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0
[src]

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

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0
[src]

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

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0
[src]

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

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0
[src]

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

impl Copy for ResponseCode
[src]

impl PartialEq<ResponseCode> for ResponseCode
[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for ResponseCode
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for ResponseCode
[src]

impl Display for ResponseCode
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T