Enum NetError
#[non_exhaustive]pub enum NetError {
Busy,
Dns(DnsError),
Message(&'static str),
Msg(String),
ParseInt(ParseIntError),
NoConnections,
Proto(ProtoError),
Io(Arc<Error>),
Timeout,
QueryCaseMismatch,
}Expand description
The error type for network protocol errors (UDP, TCP, QUIC, H2, H3)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Busy
The underlying resource is too busy
This is a signal that an internal resource is too busy. The intended action should be tried again, ideally after waiting for a little while for the situation to improve. Alternatively, the action could be tried on another resource (for example, in a name server pool).
Dns(DnsError)
Semantic DNS errors
Message(&'static str)
An error with an arbitrary message, referenced as &’static str
Msg(String)
An error with an arbitrary message, stored as String
ParseInt(ParseIntError)
Unable to parse header value as number
NoConnections
No connections available
Proto(ProtoError)
Protocol error from higher layers
Io(Arc<Error>)
An error got returned from IO
Timeout
A request timed out
QueryCaseMismatch
Case randomization is enabled, and a server did not echo a query name back with the same case.
Implementations§
§impl NetError
impl NetError
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
Trait Implementations§
§impl Error for NetError
impl Error for NetError
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
§impl From<ParseIntError> for NetError
impl From<ParseIntError> for NetError
§fn from(source: ParseIntError) -> NetError
fn from(source: ParseIntError) -> NetError
Auto Trait Implementations§
impl Freeze for NetError
impl !RefUnwindSafe for NetError
impl Send for NetError
impl Sync for NetError
impl Unpin for NetError
impl UnsafeUnpin for NetError
impl !UnwindSafe for NetError
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn 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>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 64 bytes
Size for each variant:
Busy: 0 bytesDns: 64 bytesMessage: 24 bytesMsg: 32 bytesParseInt: 5 bytesNoConnections: 0 bytesProto: 56 bytesIo: 16 bytesTimeout: 0 bytesQueryCaseMismatch: 0 bytes