add tagname

This commit is contained in:
Lennart
2024-03-14 16:15:18 +01:00
parent ade96aa559
commit de0053166a
2 changed files with 12 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ pub mod error;
pub mod proptypes;
pub mod resources;
pub mod routes;
pub mod tagname;
pub struct CalDavContext<C: CalendarStore + ?Sized> {
pub prefix: String,

View File

@@ -0,0 +1,11 @@
use strum::EnumProperty;
pub trait TagName {
fn tagname(self) -> &'static str;
}
impl<P: EnumProperty + Into<&'static str>> TagName for P {
fn tagname(self) -> &'static str {
self.get_str("tagname").unwrap_or(self.into())
}
}