[][src]Struct extract_frontmatter::Config

pub struct Config<'a> { /* fields omitted */ }

The configuration to be used when extracting frontmatter.

Implementations

impl<'a> Config<'a>[src]

pub fn new(
    number: Option<usize>,
    end_line: Option<&'a str>,
    lead_chars: Option<&'a str>,
    discard_first: bool
) -> Config<'a>
[src]

Defines a new set of extraction configuration settings.

Arguments

ArgumentDescription
numberThe exact number of lines to extract, ignoring end_line; omit for auto-detection based on end_line or consecutive lines of lead_chars
end_lineTreat the first occurrence of this string (alone on a line except for lead_chars) as the end of frontmatter
lead_charsStrip this string from the start of extracted frontmatter lines; consecutive lines starting with this string are treated as frontmatter lines if number and end_line are not specified
discard_firstWhether or not to discard the entire first line that is extracted

Panics

This function will panic if none of number, end_line, and lead_chars have been specified.

Example

use extract_frontmatter::Config;
let config = Config::new(None, Some("-->"), None, true);

pub const fn get_number(&self) -> Option<usize>[src]

pub const fn get_end_line(&self) -> Option<&str>[src]

pub const fn get_lead_chars(&self) -> Option<&str>[src]

pub const fn discard_first(&self) -> bool[src]

Trait Implementations

impl<'a> Debug for Config<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Config<'a>

impl<'a> Send for Config<'a>

impl<'a> Sync for Config<'a>

impl<'a> Unpin for Config<'a>

impl<'a> UnwindSafe for Config<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.