std.net.dns.Error
type pub inline enum ErrorAn error produced as part of a DNS query.
Constructors
InvalidHost
InvalidHost()A hostname can't be resolved (NXDomain).
Other
Other(Error)Any other kind of error, such as a network timeout.
ServerError
ServerError()The DNS server returned an error (e.g. ServFail) or produced an invalid response (e.g. systemd-resolve returning bogus data).
Instance methods
!=
Show source codeHide source code
fn pub !=(other: ref Self) -> Bool {
!(self == other)
}fn pub !=(other: ref Self) -> BoolReturns true if self and the given object are not equal to each other.
==
Show source codeHide source code
fn pub ==(other: ref Error) -> Bool {
match (self, other) {
case (InvalidHost, InvalidHost) -> true
case (ServerError, ServerError) -> true
case (Other(a), Other(b)) -> a == b
case _ -> false
}
}fn pub ==(other: ref Error) -> BoolReturns true if self and the given object are equal to each other.
This operator is used to perform structural equality. This means two objects residing in different memory locations may be considered equal, provided their structure is equal. For example, two different arrays may be considered to have structural equality if they contain the exact same values.
fmt
Show source codeHide source code
fn pub fmt(formatter: mut Formatter) {
match self {
case InvalidHost -> formatter.tuple('InvalidHost').finish
case ServerError -> formatter.tuple('ServerError').finish
case Other(e) -> formatter.tuple('Other').field(e).finish
}
}fn pub fmt(formatter: mut Formatter)Formats self in a human-readable format for debugging purposes.
to_string
Show source codeHide source code
fn pub to_string -> String {
match self {
case InvalidHost -> "the hostname can't be resolved"
case ServerError -> 'the DNS server returned an error'
case Other(e) -> e.to_string
}
}fn pub to_string -> StringConverts self to a String.
Implemented traits
Equal
impl Equal for ErrorFormat
impl Format for ErrorToString
impl ToString for Error