[−][src]Module annotate_snippets::display_list
display_list module stores the output model for the snippet.
DisplayList
is a central structure in the crate, which contains
the structured list of lines to be displayed.
It is made of two types of lines: Source
and Raw
. All Source
lines
are structured using four columns:
/------------ (1) Line number column.
| /--------- (2) Line number column delimiter.
| | /------- (3) Inline marks column.
| | | /--- (4) Content column with the source and annotations for slices.
| | | |
=============================================================================
error[E0308]: mismatched types
--> src/format.rs:51:5
|
151 | / fn test() -> String {
152 | | return "test";
153 | | }
| |___^ error: expected `String`, for `&str`.
|
The first two lines of the example above are Raw
lines, while the rest
are Source
lines.
DisplayList
does not store column alignment information, and those are
only calculated by the implementation of std::fmt::Display
using information such as
styling.
The above snippet has been built out of the following structure:
Structs
Annotation | Inline annotation which can be used in either Raw or Source line. |
DisplayList | List of lines to be displayed. |
DisplayMark | A visual mark used in |
DisplayTextFragment | An inline text fragment which any label is composed of. |
FormatOptions |
Enums
DisplayAnnotationPart | An indicator of what part of the annotation a given |
DisplayAnnotationType | A type of the |
DisplayHeaderType | Information whether the header is the initial one or a consequitive one for multi-slice cases. |
DisplayLine | A single line used in |
DisplayMarkType | A type of the |
DisplayRawLine | Raw line - a line which does not have the |
DisplaySourceLine | A source line. |
DisplayTextStyle | A style for the |