Enum DomainCheckError

Source
pub enum DomainCheckError {
    InvalidDomain {
        domain: String,
        reason: String,
    },
    NetworkError {
        message: String,
        source: Option<String>,
    },
    RdapError {
        domain: String,
        message: String,
        status_code: Option<u16>,
    },
    WhoisError {
        domain: String,
        message: String,
    },
    BootstrapError {
        tld: String,
        message: String,
    },
    ParseError {
        message: String,
        content: Option<String>,
    },
    ConfigError {
        message: String,
    },
    FileError {
        path: String,
        message: String,
    },
    Timeout {
        operation: String,
        duration: Duration,
    },
    RateLimited {
        service: String,
        message: String,
        retry_after: Option<Duration>,
    },
    Internal {
        message: String,
    },
}
Expand description

Main error type for domain checking operations.

This enum covers all possible failure modes in the domain checking process, providing detailed context for debugging and user-friendly error messages.

Variants§

§

InvalidDomain

Invalid domain name format

Fields

§domain: String
§reason: String
§

NetworkError

Network-related errors (connection, timeout, etc.)

Fields

§message: String
§source: Option<String>
§

RdapError

RDAP protocol specific errors

Fields

§domain: String
§message: String
§status_code: Option<u16>
§

WhoisError

WHOIS protocol specific errors

Fields

§domain: String
§message: String
§

BootstrapError

Bootstrap registry lookup failures

Fields

§message: String
§

ParseError

JSON parsing errors for RDAP responses

Fields

§message: String
§content: Option<String>
§

ConfigError

Configuration errors (invalid settings, etc.)

Fields

§message: String
§

FileError

File I/O errors when reading domain lists

Fields

§path: String
§message: String
§

Timeout

Timeout errors when operations take too long

Fields

§operation: String
§duration: Duration
§

RateLimited

Rate limiting errors when servers reject requests

Fields

§service: String
§message: String
§retry_after: Option<Duration>
§

Internal

Generic internal errors that don’t fit other categories

Fields

§message: String

Implementations§

Source§

impl DomainCheckError

Source

pub fn invalid_domain<D: Into<String>, R: Into<String>>( domain: D, reason: R, ) -> Self

Create a new invalid domain error.

Source

pub fn network<M: Into<String>>(message: M) -> Self

Create a new network error.

Source

pub fn network_with_source<M: Into<String>, S: Into<String>>( message: M, source: S, ) -> Self

Create a new network error with source information.

Source

pub fn rdap<D: Into<String>, M: Into<String>>(domain: D, message: M) -> Self

Create a new RDAP error.

Source

pub fn rdap_with_status<D: Into<String>, M: Into<String>>( domain: D, message: M, status_code: u16, ) -> Self

Create a new RDAP error with HTTP status code.

Source

pub fn whois<D: Into<String>, M: Into<String>>(domain: D, message: M) -> Self

Create a new WHOIS error.

Source

pub fn bootstrap<T: Into<String>, M: Into<String>>(tld: T, message: M) -> Self

Create a new bootstrap error.

Source

pub fn timeout<O: Into<String>>(operation: O, duration: Duration) -> Self

Create a new timeout error.

Source

pub fn internal<M: Into<String>>(message: M) -> Self

Create a new internal error.

Source

pub fn file_error<P: Into<String>, M: Into<String>>(path: P, message: M) -> Self

Create a new file error.

Source

pub fn indicates_available(&self) -> bool

Check if this error indicates the domain is definitely available.

Some error conditions (like NXDOMAIN) actually indicate availability.

Source

pub fn is_retryable(&self) -> bool

Check if this error suggests the operation should be retried.

Trait Implementations§

Source§

impl Clone for DomainCheckError

Source§

fn clone(&self) -> DomainCheckError

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DomainCheckError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DomainCheckError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for DomainCheckError

1.30.0 · Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for DomainCheckError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for DomainCheckError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for DomainCheckError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for DomainCheckError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,