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: Stringpublished: Stringimage: Stringslug: Stringartwork_credit: Stringestimated_read_time: Stringmetadata: Stringtable_of_contents: Stringurl: Stringrender_path: Stringtemplate_path: Stringtemplate_raw: StringImplementations
sourceimpl Post
impl Post
sourcepub fn new() -> Post
pub fn new() -> Post
Create a new instance of Post, where all fields are instantiated to empty strings using String::new()
sourcepub fn list(config: &Antwerp, sorter: fn(_: Vec<Post>) -> Vec<Post>) -> Vec<Post>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn list(config: &Antwerp, sorter: fn(_: Vec<Post>) -> Vec<Post>) -> Vec<Post>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more