#[non_exhaustive]pub struct Split<'a> {
pub yaml: Option<&'a str>,
pub yaml_range: Range<usize>,
pub body: &'a str,
pub body_start: usize,
pub shape: NoteShape,
pub unterminated: bool,
}Expand description
A note split into its parts, with byte offsets into the original source.
The fields are public to read, but the type is #[non_exhaustive]. You get
one from split, never a struct literal, so a later field is not a
breaking change.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.yaml: Option<&'a str>The frontmatter YAML, verbatim and without the --- fences. None
when the note has no frontmatter block at all.
yaml_range: Range<usize>Byte range of yaml within the source (empty when yaml is None).
body: &'a strEverything after the closing fence.
body_start: usizeByte offset of body within the source.
shape: NoteShapeThe framing to restore when writing this note back.
unterminated: booltrue when the note opens a frontmatter block that never closes: it
starts with a valid opening fence (--- and a line break, after an
optional BOM) and no closing --- line follows. yaml is still None
and body the whole text, as for a note with no block, so a reader of
many notes keeps going. A caller that requires valid frontmatter can
read this to report the note as malformed instead. false otherwise.