pub struct Post {
Show 20 fields pub title: String, pub description: String, pub category: String, pub subcategory: String, pub genre: String, pub keywords: String, pub tags: String, pub published: String, pub image: String, pub author: String, pub author_github: String, pub slug: String, pub artwork_credit: String, pub estimated_read_time: String, pub metadata: String, pub table_of_contents: String, pub url: String, pub render_path: String, pub template_path: String, pub template_raw: String,
}
Expand description

A struct that simplifies post management. Encapsulates post data and contains methods to extract data from and generate data for posts and collect Vectors containing Post objects for each post.

Extracted (user-defined) post data:

  • title
  • description
  • category
  • subcategory
  • genre
  • keywords
  • tags
  • published
  • image
  • author

Generated post data:

  • slug
  • artwork_credit
  • estimated_read_time
  • metadata
  • table_of_contents

Post template data:

  • template_path
  • render_path
  • url
  • content

Fields

title: Stringdescription: Stringcategory: Stringsubcategory: Stringgenre: Stringkeywords: Stringtags: Stringpublished: Stringimage: Stringauthor: Stringauthor_github: Stringslug: Stringartwork_credit: Stringestimated_read_time: Stringmetadata: Stringtable_of_contents: Stringurl: Stringrender_path: Stringtemplate_path: Stringtemplate_raw: String

Implementations

source

impl Post

Create a new instance of Post, where all fields are instantiated to empty strings using String::new()

Create a Vector containing Post objects containing information for each post in a specified directory. Use with PostConfig

Behaviour:

  • Extract all templates in the config’s dir_tem

Trait Implementations

source

impl Serialize for Post

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

impl RefUnwindSafe for Post

impl Send for Post

impl Sync for Post

impl Unpin for Post

impl UnwindSafe for Post

Blanket Implementations

source

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

Gets the TypeId of self. Read more

source

impl<T> Borrow<T> for T where
    T: ?Sized

Immutably borrows from an owned value. Read more

source

impl<T> BorrowMut<T> for T where
    T: ?Sized

Mutably borrows from an owned value. Read more

source

impl<T> From<T> for T

Returns the argument unchanged.

source

impl<T, U> Into<U> for T where
    U: From<T>, 

Calls U::from(self).

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

source

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

The type returned in the event of a conversion error.

Performs the conversion.

source

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

The type returned in the event of a conversion error.

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,