use chrono::{DateTime, Utc}; use crate::posts::Post; pub struct Poem { file_name: String, title: Option, created_at: DateTime, published_at: DateTime, updated_at: Option>, content: String, // TODO: localisation (get lang from file names) lang: String, } impl Post for Poem { fn id(&self) -> &str { &self.file_name } fn subject(&self) -> Option<&str> { self.title.as_deref() } fn published_at(&self) -> &DateTime { &self.published_at } fn updated_at(&self) -> Option<&DateTime> { self.updated_at.as_ref() } fn tags(&self) -> &Vec { todo!() } fn lang(&self) -> &str { "en" } fn post_type(&self) -> crate::posts::PostType { todo!() } fn content(&self) -> &str { todo!() } }