Enum trust_dns_proto::op::response_code::ResponseCode
source · [−]pub enum ResponseCode {
Show 21 variants
NoError,
FormErr,
ServFail,
NXDomain,
NotImp,
Refused,
YXDomain,
YXRRSet,
NXRRSet,
NotAuth,
NotZone,
BADVERS,
BADSIG,
BADKEY,
BADTIME,
BADMODE,
BADNAME,
BADALG,
BADTRUNC,
BADCOOKIE,
Unknown(u16),
}
Expand description
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-Existent 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
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
Unknown(u16)
An unknown or unregisterd response code was received.
Implementations
sourceimpl ResponseCode
impl ResponseCode
sourcepub fn low(self) -> u8
pub fn low(self) -> u8
returns the lower 4 bits of the response code (for the original header portion of the code)
sourcepub fn from_low(low: u8) -> Self
pub fn from_low(low: u8) -> Self
DNS can not store the entire space of ResponseCodes in 4 bit space of the Header, this function allows for a initial value of the first 4 bits to be set.
After the EDNS is read, the entire ResponseCode (12 bits) can be reconstructed for the full ResponseCode.
Trait Implementations
sourceimpl Clone for ResponseCode
impl Clone for ResponseCode
sourcefn clone(&self) -> ResponseCode
fn clone(&self) -> ResponseCode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ResponseCode
impl Debug for ResponseCode
sourceimpl Default for ResponseCode
impl Default for ResponseCode
sourceimpl Display for ResponseCode
impl Display for ResponseCode
sourceimpl From<ResponseCode> for u16
impl From<ResponseCode> for u16
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);
sourcefn from(rt: ResponseCode) -> Self
fn from(rt: ResponseCode) -> Self
Converts to this type from the input type.
sourceimpl From<u16> for ResponseCode
impl From<u16> for ResponseCode
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);
sourceimpl Hash for ResponseCode
impl Hash for ResponseCode
sourceimpl PartialEq<ResponseCode> for ResponseCode
impl PartialEq<ResponseCode> for ResponseCode
sourcefn eq(&self, other: &ResponseCode) -> bool
fn eq(&self, other: &ResponseCode) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ResponseCode) -> bool
fn ne(&self, other: &ResponseCode) -> bool
This method tests for !=
.
sourceimpl PartialOrd<ResponseCode> for ResponseCode
impl PartialOrd<ResponseCode> for ResponseCode
sourcefn partial_cmp(&self, other: &ResponseCode) -> Option<Ordering>
fn partial_cmp(&self, other: &ResponseCode) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn le(&self, other: &Rhs) -> bool
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
impl Copy for ResponseCode
impl Eq for ResponseCode
impl StructuralEq for ResponseCode
impl StructuralPartialEq for ResponseCode
Auto Trait Implementations
impl RefUnwindSafe for ResponseCode
impl Send for ResponseCode
impl Sync for ResponseCode
impl Unpin for ResponseCode
impl UnwindSafe for ResponseCode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more