diff options
Diffstat (limited to 'src/modules/blog/config.rs')
| -rw-r--r-- | src/modules/blog/config.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/blog/config.rs b/src/modules/blog/config.rs index 20c3bd4..c2e4cc9 100644 --- a/src/modules/blog/config.rs +++ b/src/modules/blog/config.rs @@ -1,6 +1,7 @@ -use std::collections::HashMap; - -use serde::{Deserialize, Serialize}; +use { + serde::{Deserialize, Serialize}, + std::collections::HashMap, +}; #[derive(Serialize, Deserialize, Clone, Default)] pub struct Entry { @@ -27,6 +28,7 @@ pub struct Blog { name: Option<String>, description: Option<String>, posts: Option<HashMap<String, Entry>>, + priority: Option<u8>, } impl Blog { pub const fn description(&self) -> &Option<String> { &self.description } @@ -35,6 +37,8 @@ impl Blog { pub const fn posts(&self) -> &Option<HashMap<String, Entry>> { &self.posts } + pub const fn priority(&self) -> &Option<u8> { &self.priority } + pub fn from_string(string: &str) -> serde_json::Result<Self> { serde_json::from_str(string) } |