pub struct Post {
    pub file_path: PathBuf,
    pub url: UrlBuf,
    pub title: String,
    pub date: String,
    pub body: String,
    pub tags: HashSet<Tag>,
}
Expand description

Represents a blog post.

Fields

file_path: PathBuf

The output path where the final post file will be rendered.

url: UrlBuf

The address for the rendered post.

title: String

The title of the post.

date: String

The date of the post.

body: String

The body of the post.

tags: HashSet<Tag>

The tags associated with the post.

Implementations

Converts a Post into a template-renderable Value, representing a full post (as opposed to Post::summarize which represents a post summary). The resulting Value has fields:

  • url: The url of the post
  • title: The title of the post
  • date: The published date of the post
  • body: The post body
  • tags: A list of tags associated with the post

Returns the full post body unless a <!-- more --> tag was found, in which case it returns the text up to that tag (the “summary” text). It also returns a boolean value indicating whether or not the tag was found.

Converts a Post into a template-renderable Value representing a post summary. The resulting Value has fields:

  • url: The url of the post
  • title: The title of the post
  • date: The published date of the post
  • summary: The post summary if there is a <!-- more --> tag or else the full post body
  • summarized: A boolean value representing whether or not a <!-- more --> tag was found and thus the post was truncated.
  • tags: A list of tags associated with the post

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Deserialize this value from the given Serde deserializer. Read more

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.