Enum ResponseCode
#[non_exhaustive]pub enum ResponseCode {
Show 21 variants
NoError,
FormErr,
ServFail,
NXDomain,
NotImp,
Refused,
YXDomain,
YXRRSet,
NXRRSet,
NotAuth,
NotZone,
DSOTYPENI,
BADVERS,
BADKEY,
BADTIME,
BADMODE,
BADNAME,
BADALG,
BADTRUNC,
BADCOOKIE,
Unknown(u8),
}dns and std only.Expand description
A DNS response code (RCODE) from the IANA DNS RCODEs registry.
The message header carries only the low four bits; EDNS(0) and TSIG
widen the field by supplying the upper bits, so values above 15 only
occur once those extensions have been read. Unassigned and private-use
values are retained by ResponseCode::Unknown.
This list reflects a snapshot of the IANA DNS RCODEs registry taken on 2026-09-16, restricted to the values that fit the octet this enum stores. The registry reserves everything up to 65535 for future use.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoError
Reports that no error occurred.
FormErr
Reports that the server could not interpret the query.
ServFail
Reports a failure that prevented the server from answering.
NXDomain
Reports that the queried name does not exist.
NotImp
Reports that the server does not implement the requested query.
Refused
Reports that policy prevented the server from answering.
YXDomain
Reports that a name exists that the update required to be absent.
YXRRSet
Reports that an RRset exists that the update required to be absent.
NXRRSet
Reports that an RRset the update required to be present is absent.
NotAuth
Reports an unauthorized update, or a server not authoritative for the zone.
NotZone
Reports a name outside the zone named in the update.
DSOTYPENI
Reports a DSO-TYPE that the server does not implement.
BADVERS
Reports an unsupported EDNS version, and a bad TSIG signature.
The registry assigns this value twice: BADVERS for EDNS and
BADSIG for TSIG. Which one applies follows from the extension
that carried the code.
BADKEY
Reports a key not recognized by the server.
BADTIME
Reports a signature outside its validity window.
BADMODE
Reports a bad TKEY mode.
BADNAME
Reports a duplicate key name.
BADALG
Reports an algorithm that the server does not support.
BADTRUNC
Reports a truncated TSIG message authentication code.
BADCOOKIE
Reports a bad or missing server cookie.
Unknown(u8)
Retains an unrecognized numeric value.
Implementations§
§impl ResponseCode
impl ResponseCode
pub fn variant_name(&self) -> Cow<'static, str>
pub fn variant_name(&self) -> Cow<'static, str>
Return this value’s variant name, or its decimal number when the value is unknown.
Known values borrow their 'static mnemonic, and
Self::Unknown values render their numeric value. Unlike
Display and Debug the result is a bare, stable label,
suitable for log fields, metrics, and telemetry.
Trait Implementations§
§impl Clone for ResponseCode
impl Clone for ResponseCode
§fn clone(&self) -> ResponseCode
fn clone(&self) -> ResponseCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ResponseCode
§impl Debug for ResponseCode
impl Debug for ResponseCode
§impl<'de> Deserialize<'de> for ResponseCode
impl<'de> Deserialize<'de> for ResponseCode
§fn deserialize<D>(
deserializer: D,
) -> Result<ResponseCode, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ResponseCode, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Display for ResponseCode
impl Display for ResponseCode
impl Eq for ResponseCode
§impl From<ResponseCode> for u8
impl From<ResponseCode> for u8
§fn from(value: ResponseCode) -> u8
fn from(value: ResponseCode) -> u8
§impl From<u8> for ResponseCode
impl From<u8> for ResponseCode
§fn from(x: u8) -> ResponseCode
fn from(x: u8) -> ResponseCode
§impl Hash for ResponseCode
impl Hash for ResponseCode
§impl LowerHex for ResponseCode
impl LowerHex for ResponseCode
§impl Ord for ResponseCode
impl Ord for ResponseCode
§fn cmp(&self, other: &ResponseCode) -> Ordering
fn cmp(&self, other: &ResponseCode) -> Ordering
Compare by numeric value, then distinguish colliding variants.
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
§impl PartialEq for ResponseCode
impl PartialEq for ResponseCode
§impl PartialOrd for ResponseCode
impl PartialOrd for ResponseCode
§impl Serialize for ResponseCode
impl Serialize for ResponseCode
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for ResponseCode
Auto Trait Implementations§
impl Freeze for ResponseCode
impl RefUnwindSafe for ResponseCode
impl Send for ResponseCode
impl Sync for ResponseCode
impl Unpin for ResponseCode
impl UnsafeUnpin for ResponseCode
impl UnwindSafe for ResponseCode
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.