Struct annotate_snippets::Slice
source · 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 str§line_start: usize§origin: 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.
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Slice<'a>
impl<'a> Send for Slice<'a>
impl<'a> Sync for Slice<'a>
impl<'a> Unpin for Slice<'a>
impl<'a> UnwindSafe for Slice<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more