use crate::display_list::FormatOptions;
#[derive(Debug, Default)]
pub struct Snippet<'a> {
pub title: Option<Annotation<'a>>,
pub footer: Vec<Annotation<'a>>,
pub slices: Vec<Slice<'a>>,
pub opt: FormatOptions,
}
#[derive(Debug)]
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,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum AnnotationType {
Error,
Warning,
Info,
Note,
Help,
}
#[derive(Debug)]
pub struct SourceAnnotation<'a> {
pub range: (usize, usize),
pub label: &'a str,
pub annotation_type: AnnotationType,
}
#[derive(Debug)]
pub struct Annotation<'a> {
pub id: Option<&'a str>,
pub label: Option<&'a str>,
pub annotation_type: AnnotationType,
}