pub struct Parser<'a> { /* private fields */ }
Expand description

Parses Post objects from source files.

Implementations

Constructs a new parser. See fields on Parser for argument descriptions.

Searches a provided source_directory for post files (extension = .md) and returns a list of Post objects sorted by date (most recent first). Each post file must be structured as follows:

  1. Initial frontmatter fence (---)
  2. YAML frontmatter with fields Title, Date, and optionally Tags
  3. Terminal frontmatter fence (---)
  4. Post body

For example:

---
Title: Hello, world!
Date: 2021-04-16
Tags: [greet]
---

World

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.