Struct blog_tools::Blog
source · pub struct Blog {
pub hash: HashMap<String, BlogEntry>,
pub entries: Vec<BlogEntry>,
pub tags: Vec<String>,
}Expand description
The main Blog which stores all relevant information for the blog
hash contains a map from the url slug defined in the BlogJson to the
BlogEntry
entries contains a date-sorted Vec of BlogEntry. Note that entries
and hash contain the same information but in different formats for
performance reasons
tags is an unsorted Vec of all unique tags used in the blog
Fields§
§hash: HashMap<String, BlogEntry>URL slug to individual blog
Useful when you have a GET request to /blog/<slug>
entries: Vec<BlogEntry>Vec of blog posts, sorted by date
Useful when you want to list all blog posts e.g. on an index page
Vec of all unique tags
Useful when you want to list all tags e.g. on an index page
Trait Implementations§
source§impl<'de> Deserialize<'de> for Blog
impl<'de> Deserialize<'de> for Blog
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Blog
impl Send for Blog
impl Sync for Blog
impl Unpin for Blog
impl UnwindSafe for Blog
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more