#[non_exhaustive]pub struct Snippet<'a> {
pub origin: Option<Cow<'a, str>>,
pub line_start: usize,
pub source: Cow<'a, str>,
pub annotations: Vec<Annotation<'a>>,
pub fold: bool,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.origin: Option<Cow<'a, str>>§line_start: usize§source: Cow<'a, str>§annotations: Vec<Annotation<'a>>§fold: boolImplementations§
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
pub fn fold(self, fold: bool) -> Self
Trait Implementations§
Source§impl<'de, 'a> Deserialize<'de> for Snippet<'a>
impl<'de, 'a> Deserialize<'de> for Snippet<'a>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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