diff options
Diffstat (limited to 'src/modules/blog/post.rs')
| -rw-r--r-- | src/modules/blog/post.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/modules/blog/post.rs b/src/modules/blog/post.rs new file mode 100644 index 0000000..fb697ae --- /dev/null +++ b/src/modules/blog/post.rs @@ -0,0 +1,17 @@ +pub struct Post { + title: String, + link: String, + created_at: String, +} + +impl Post { + pub const fn new(title: String, link: String, created_at: String) -> Self { + Self { title, link, created_at } + } + + pub const fn title(&self) -> &String { &self.title } + + pub const fn link(&self) -> &String { &self.link } + + pub const fn created_at(&self) -> &String { &self.created_at } +} |