Skip to main content

Error

Trait Error 

Source
pub trait Error: Error {
    // Required method
    fn help(&self) -> Option<Cow<'_, str>>;

    // Provided method
    fn span(&self) -> Option<ErrSpan> { ... }
}
Expand description

Unified error interface for all errors in this crate.

Note that the Display implementation is used for a brief message, where as Error::help is used for any clarifying messages.

Required Methods§

Source

fn help(&self) -> Option<Cow<'_, str>>

A clarifying message to help aid someone in how to fix the message.

If there is none to add, this can be set to None.

Provided Methods§

Source

fn span(&self) -> Option<ErrSpan>

The range where this error occurs in source.

If this is not known, this can be set to None.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§