Struct ProtoError
#[non_exhaustive]pub struct ProtoError {
pub kind: Box<ProtoErrorKind>,
}
Expand description
The error type for errors that get returned in the crate
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: Box<ProtoErrorKind>
Kind of error that occurred
Implementations§
§impl ProtoError
impl ProtoError
pub fn nx_error(
query: Box<Query>,
soa: Option<Box<Record<SOA>>>,
ns: Option<Arc<[ForwardNSData]>>,
negative_ttl: Option<u32>,
response_code: ResponseCode,
trusted: bool,
authorities: Option<Arc<[Record]>>,
) -> ProtoError
pub fn nx_error( query: Box<Query>, soa: Option<Box<Record<SOA>>>, ns: Option<Arc<[ForwardNSData]>>, negative_ttl: Option<u32>, response_code: ResponseCode, trusted: bool, authorities: Option<Arc<[Record]>>, ) -> ProtoError
Constructor to NX type errors
pub fn kind(&self) -> &ProtoErrorKind
pub fn kind(&self) -> &ProtoErrorKind
Get the kind of the error
pub fn is_no_connections(&self) -> bool
pub fn is_no_connections(&self) -> bool
Returns true if this error represents NoConnections
pub fn is_nx_domain(&self) -> bool
pub fn is_nx_domain(&self) -> bool
Returns true if the domain does not exist
pub fn is_no_records_found(&self) -> bool
pub fn is_no_records_found(&self) -> bool
Returns true if the error represents NoRecordsFound
pub fn from_response(
response: DnsResponse,
trust_nx: bool,
) -> Result<DnsResponse, ProtoError>
pub fn from_response( response: DnsResponse, trust_nx: bool, ) -> Result<DnsResponse, ProtoError>
A conversion to determine if the response is an error
pub fn cmp_specificity(&self, other: &ProtoError) -> Ordering
pub fn cmp_specificity(&self, other: &ProtoError) -> Ordering
Compare two errors to see if one contains a server response.
Trait Implementations§
§impl Clone for ProtoError
impl Clone for ProtoError
§fn clone(&self) -> ProtoError
fn clone(&self) -> ProtoError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for ProtoError
impl Debug for ProtoError
§impl Display for ProtoError
impl Display for ProtoError
§impl Error for ProtoError
impl Error for ProtoError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
§impl From<&'static str> for ProtoError
impl From<&'static str> for ProtoError
§fn from(msg: &'static str) -> ProtoError
fn from(msg: &'static str) -> ProtoError
Converts to this type from the input type.
§impl From<DecodeError> for ProtoError
impl From<DecodeError> for ProtoError
§fn from(err: DecodeError) -> ProtoError
fn from(err: DecodeError) -> ProtoError
Converts to this type from the input type.
§impl<E> From<E> for ProtoErrorwhere
E: Into<ProtoErrorKind>,
impl<E> From<E> for ProtoErrorwhere
E: Into<ProtoErrorKind>,
§fn from(error: E) -> ProtoError
fn from(error: E) -> ProtoError
Converts to this type from the input type.
§impl<T> From<PoisonError<T>> for ProtoError
impl<T> From<PoisonError<T>> for ProtoError
§fn from(_e: PoisonError<T>) -> ProtoError
fn from(_e: PoisonError<T>) -> ProtoError
Converts to this type from the input type.
§impl From<ProtoError> for DnsResponseStream
impl From<ProtoError> for DnsResponseStream
§fn from(e: ProtoError) -> DnsResponseStream
fn from(e: ProtoError) -> DnsResponseStream
Converts to this type from the input type.
§impl From<ProtoError> for Error
impl From<ProtoError> for Error
§fn from(e: ProtoError) -> Error
fn from(e: ProtoError) -> Error
Converts to this type from the input type.
§impl From<ProtoError> for ResolveError
impl From<ProtoError> for ResolveError
§fn from(e: ProtoError) -> ResolveError
fn from(e: ProtoError) -> ResolveError
Converts to this type from the input type.
§impl From<ProtoError> for ResolveErrorKind
impl From<ProtoError> for ResolveErrorKind
§fn from(source: ProtoError) -> ResolveErrorKind
fn from(source: ProtoError) -> ResolveErrorKind
Converts to this type from the input type.
§impl From<ProtoError> for String
impl From<ProtoError> for String
§fn from(e: ProtoError) -> String
fn from(e: ProtoError) -> String
Converts to this type from the input type.
§impl From<String> for ProtoError
impl From<String> for ProtoError
§fn from(msg: String) -> ProtoError
fn from(msg: String) -> ProtoError
Converts to this type from the input type.
§impl RetryableError for ProtoError
impl RetryableError for ProtoError
Auto Trait Implementations§
impl Freeze for ProtoError
impl !RefUnwindSafe for ProtoError
impl Send for ProtoError
impl Sync for ProtoError
impl Unpin for ProtoError
impl !UnwindSafe for ProtoError
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Error> ErrorExt for Error
impl<Error> ErrorExt for Error
§fn context<M>(self, context: M) -> OpaqueError
fn context<M>(self, context: M) -> OpaqueError
Wrap the error in a context. Read more
§fn with_context<C, F>(self, context: F) -> OpaqueError
fn with_context<C, F>(self, context: F) -> OpaqueError
Lazily wrap the error with a context. Read more
§fn backtrace(self) -> OpaqueError
fn backtrace(self) -> OpaqueError
§fn into_opaque(self) -> OpaqueError
fn into_opaque(self) -> OpaqueError
Convert the error into an
OpaqueError
. Read more§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> ⓘ
Converts
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> ⓘ
Converts
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> 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>
Create a new
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> ToSmolStr for T
impl<T> ToSmolStr for T
fn to_smolstr(&self) -> SmolStr
§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.