#[non_exhaustive]
pub enum Splitter {
    LineIndex(usize),
    DelimiterLine(String),
    LinePrefix(String),
}
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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

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(String)

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(String)

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.