[−][src]Struct extract_frontmatter::Config
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]
number: Option<usize>,
end_line: Option<&'a str>,
lead_chars: Option<&'a str>,
discard_first: bool
) -> Config<'a>
Defines a new set of extraction configuration settings.
Arguments
| Argument | Description |
|---|---|
number | The exact number of lines to extract, ignoring end_line; omit for auto-detection based on end_line or consecutive lines of lead_chars |
end_line | Treat the first occurrence of this string (alone on a line except for lead_chars) as the end of frontmatter |
lead_chars | Strip 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_first | Whether 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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,