use std::borrow::Cow;
use strum_macros::IntoStaticStr;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "kebab-case")]
pub struct PageInfo<'a> {
pub slug: Cow<'a, str>,
pub title: Cow<'a, str>,
pub alt_title: Option<Cow<'a, str>>,
pub header: Option<Cow<'a, str>>,
pub subheader: Option<Cow<'a, str>>,
pub rating: f32,
pub tags: Vec<Cow<'a, str>>,
}
#[derive(
Serialize, Deserialize, IntoStaticStr, Debug, Copy, Clone, Hash, PartialEq, Eq,
)]
#[serde(rename_all = "kebab-case")]
pub enum InfoField {
Title,
Header,
SubHeader,
}
impl InfoField {
#[inline]
pub fn name(self) -> &'static str {
self.into()
}
}