blob: f5f194c3d5e0dc533506c072fe1169d5db29a36b (
plain) (
tree)
|
|
use chrono::{DateTime, Utc};
use crate::posts::Post;
pub struct Poem {
file_name: String,
title: Option<String>,
created_at: DateTime<Utc>,
published_at: DateTime<Utc>,
updated_at: Option<DateTime<Utc>>,
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<Utc> {
&self.published_at
}
fn updated_at(&self) -> Option<&DateTime<Utc>> {
self.updated_at.as_ref()
}
fn tags(&self) -> &Vec<String> {
todo!()
}
fn lang(&self) -> &str {
"en"
}
fn post_type(&self) -> crate::posts::PostType {
todo!()
}
fn content(&self) -> &str {
todo!()
}
}
|