pub struct Snippet<'a> { /* private fields */ }
Expand description
Structure containing the slice of text to be annotated and basic information about the location of the slice.
One Snippet
is meant to represent a single, continuous,
slice of source code that you want to annotate.
Implementations§
source§impl<'a> Snippet<'a>
impl<'a> Snippet<'a>
pub fn source(source: &'a str) -> Self
pub fn line_start(self, line_start: usize) -> Self
pub fn origin(self, origin: &'a str) -> Self
pub fn annotation(self, annotation: Annotation<'a>) -> Self
pub fn annotations( self, annotation: impl IntoIterator<Item = Annotation<'a>>, ) -> Self
sourcepub fn fold(self, fold: bool) -> Self
pub fn fold(self, fold: bool) -> Self
Hide lines without Annotation
s
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Snippet<'a>
impl<'a> RefUnwindSafe for Snippet<'a>
impl<'a> Send for Snippet<'a>
impl<'a> Sync for Snippet<'a>
impl<'a> Unpin for Snippet<'a>
impl<'a> UnwindSafe for Snippet<'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