Trait srcerr::model::ErrorDetail[][src]

pub trait ErrorDetail<'files> {
    type Files: Files<'files>;
    fn labels(&self) -> Vec<Label<<Self::Files as Files<'files>>::FileId>>;
fn notes(&self, files: &Self::Files) -> Vec<String>; }

Detail of a specific error.

While ErrorCode represents a class of error, ErrorDetail captures the information for this specific instance of the error.

Associated Types

type Files: Files<'files>[src]

Type of the collection of data that the error arises from.

Each data file may be valid on its own, but the interaction of values may produce the error.

Loading content...

Required methods

fn labels(&self) -> Vec<Label<<Self::Files as Files<'files>>::FileId>>[src]

Returns Labels used for rendering.

These are the parts of the file content to be highlighted to the user, i.e. the parts underlined with - or ^ in the following snippet:

 7 | available: ["abc", "def"]
   |            -------------- allowed values are defined here
 8 | selected: "ghi"
   |           ^^^^^ this is not an available value.

fn notes(&self, files: &Self::Files) -> Vec<String>[src]

Returns the notes to display beneath the error snippets.

These appear beneath the code snippet, e.g. the text following the = sign in the following snippet:

 8 | selected: "ghi"
   |           ^^^^^ this is not an available value.
   |
   = `selected` value must come from one of the `available` values.
Loading content...

Implementors

Loading content...