Struct blog_tools::medium::MediumBlog
source · pub struct MediumBlog {
pub hash: HashMap<String, MediumBlogEntry>,
pub entries: Vec<MediumBlogEntry>,
pub tags: Vec<String>,
}
Expand description
The main MediumBlog
which stores all relevant information for the blog
hash
contains a map from the url slug, which is constructed from the
“slug” field in the BlogJson
and the date, to the BlogEntry
entries
contains a date-sorted (newest first) 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, MediumBlogEntry>
URL slug to individual blog
Useful when you have a GET request to /blog/<date>/<slug>
entries: Vec<MediumBlogEntry>
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 MediumBlog
impl<'de> Deserialize<'de> for MediumBlog
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 Freeze for MediumBlog
impl RefUnwindSafe for MediumBlog
impl Send for MediumBlog
impl Sync for MediumBlog
impl Unpin for MediumBlog
impl UnwindSafe for MediumBlog
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