Struct annotate_snippets::snippet::Slice [−][src]
pub struct Slice<'a> {
pub source: &'a str,
pub line_start: usize,
pub origin: Option<&'a str>,
pub annotations: Vec<SourceAnnotation<'a>>,
pub fold: bool,
}Expand description
Structure containing the slice of text to be annotated and basic information about the location of the slice.
One Slice is meant to represent a single, continuous,
slice of source code that you want to annotate.
Fields
source: &'a strline_start: usizeorigin: Option<&'a str>annotations: Vec<SourceAnnotation<'a>>fold: boolIf set explicitly to true, the snippet will fold
parts of the slice that don’t contain any annotations.