Struct mdns::errors::Error
[−]
pub struct Error { pub kind: ErrorKind, pub state: State, }
The Error type
This has a simple structure to support pattern matching during error handling. The second field is internal state that is mostly irrelevant for error handling purposes.
Fields
kind: ErrorKind
The kind of the error.
state: State
Contains the error chain and the backtrace.
Methods
impl Error
impl Error
fn from_kind(kind: ErrorKind) -> Error
Constructs an error from a kind.
fn kind(&self) -> &ErrorKind
Returns the kind of the error.
fn iter(&self) -> ErrorChainIter
Iterates over the error chain.
Methods from Deref<Target = ErrorKind>
fn description(&self) -> &str
A string describing the error kind.
Trait Implementations
impl Debug for Error
impl ChainedError for Error
type ErrorKind = ErrorKind
Associated kind type.
fn new(kind: ErrorKind, state: State) -> Error
Creates an error from it's parts.
fn extract_backtrace(
e: &Error + Send + 'static
) -> Option<Option<Arc<Backtrace>>>
e: &Error + Send + 'static
) -> Option<Option<Arc<Backtrace>>>
Returns the first known backtrace, either from it's State or from one of the errors from foreign_links
. Read more
impl Error for Error
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
The lower-level cause of this error, if any. Read more