use super::AttributeMap;
use std::borrow::Cow;
use std::num::NonZeroU32;
use strum_macros::IntoStaticStr;
#[derive(Serialize, Deserialize, IntoStaticStr, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "kebab-case", tag = "module", content = "data")]
pub enum Module<'t> {
Backlinks { page: Option<Cow<'t, str>> },
#[serde(rename_all = "kebab-case")]
Categories { include_hidden: bool },
#[serde(rename_all = "kebab-case")]
Join {
button_text: Option<Cow<'t, str>>,
attributes: AttributeMap<'t>,
},
#[serde(rename_all = "kebab-case")]
PageTree {
root: Option<Cow<'t, str>>,
show_root: bool,
depth: Option<NonZeroU32>,
},
Rate,
}
impl Module<'_> {
#[inline]
pub fn name(&self) -> &'static str {
self.into()
}
}