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.

Implementors§