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: bool

If set explicitly to true, the snippet will fold parts of the slice that don’t contain any annotations.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.