Enum extract_frontmatter::config::Splitter
source · [−]#[non_exhaustive]
pub enum Splitter<'opt> {
LineIndex(usize),
DelimiterLine(&'opt str),
LinePrefix(&'opt str),
}Expand description
Ways of distinguishing front-matter from the rest of the data in some text.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
LineIndex(usize)
All lines before this line will be treated as front-matter; everything else (including this line) will be returned as data. If there are less lines than specified here, then everything will be treated as front-matter.
DelimiterLine(&'opt str)
All lines before the first line matching this text (ignoring leading and trailing whitespace differences) will be treated as front-matter; everything else (excluding this line, as it is discarded) will be returned as data. If no line is found matching this text, then everything will be treated as front-matter.
LinePrefix(&'opt str)
All lines prefixed with this text, up to (and not including) the first line that is not prefixed, will be
treated as front-matter; everything else will be returned as data. If no lines are found with this prefix, then
everything will be treated as data. Note that the prefix will not be stripped automatically; use
Modifier::StripPrefix to explicitly strip the prefix.
Trait Implementations
Auto Trait Implementations
impl<'opt> RefUnwindSafe for Splitter<'opt>
impl<'opt> Send for Splitter<'opt>
impl<'opt> Sync for Splitter<'opt>
impl<'opt> Unpin for Splitter<'opt>
impl<'opt> UnwindSafe for Splitter<'opt>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more