mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
remove unnecessary enumproperty trait
This commit is contained in:
@@ -10,7 +10,7 @@ use rustical_dav::{
|
||||
use rustical_store::calendar::{Calendar, CalendarStore};
|
||||
use serde::Serialize;
|
||||
use std::sync::Arc;
|
||||
use strum::{EnumProperty, EnumString, IntoStaticStr, VariantNames};
|
||||
use strum::{EnumString, IntoStaticStr, VariantNames};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
pub struct CalendarResource<C: CalendarStore + ?Sized> {
|
||||
@@ -117,20 +117,16 @@ impl Default for UserPrivilegeSet {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(EnumString, Debug, VariantNames, IntoStaticStr, EnumProperty, Clone)]
|
||||
#[derive(EnumString, Debug, VariantNames, IntoStaticStr, Clone)]
|
||||
#[strum(serialize_all = "kebab-case")]
|
||||
pub enum CalendarProp {
|
||||
Resourcetype,
|
||||
CurrentUserPrincipal,
|
||||
Owner,
|
||||
Displayname,
|
||||
// #[strum(props(tagname = "IC:calendar-color"))]
|
||||
CalendarColor,
|
||||
// #[strum(props(tagname = "C:calendar-description"))]
|
||||
CalendarDescription,
|
||||
// #[strum(props(tagname = "C:supported-calendar-component-set"))]
|
||||
SupportedCalendarComponentSet,
|
||||
// #[strum(props(tagname = "C:supported-calendar-data"))]
|
||||
SupportedCalendarData,
|
||||
Getcontenttype,
|
||||
CurrentUserPrivilegeSet,
|
||||
|
||||
@@ -8,7 +8,7 @@ use rustical_store::calendar::CalendarStore;
|
||||
use rustical_store::event::Event;
|
||||
use serde::Serialize;
|
||||
use std::sync::Arc;
|
||||
use strum::{EnumProperty, EnumString, IntoStaticStr, VariantNames};
|
||||
use strum::{EnumString, IntoStaticStr, VariantNames};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
pub struct EventResource<C: CalendarStore + ?Sized> {
|
||||
@@ -17,11 +17,10 @@ pub struct EventResource<C: CalendarStore + ?Sized> {
|
||||
pub event: Event,
|
||||
}
|
||||
|
||||
#[derive(EnumString, Debug, VariantNames, IntoStaticStr, EnumProperty, Clone)]
|
||||
#[derive(EnumString, Debug, VariantNames, IntoStaticStr, Clone)]
|
||||
#[strum(serialize_all = "kebab-case")]
|
||||
pub enum EventProp {
|
||||
Getetag,
|
||||
#[strum(props(tagname = "C:calendar-data"))]
|
||||
CalendarData,
|
||||
Getcontenttype,
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use rustical_dav::{resource::Resource, xml_snippets::HrefElement};
|
||||
use rustical_store::calendar::CalendarStore;
|
||||
use serde::Serialize;
|
||||
use std::sync::Arc;
|
||||
use strum::{EnumProperty, EnumString, IntoStaticStr, VariantNames};
|
||||
use strum::{EnumString, IntoStaticStr, VariantNames};
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
use super::calendar::CalendarResource;
|
||||
@@ -39,16 +39,14 @@ pub enum PrincipalPropResponse {
|
||||
CalendarUserAddressSet(HrefElement),
|
||||
}
|
||||
|
||||
#[derive(EnumString, Debug, VariantNames, IntoStaticStr, EnumProperty, Clone)]
|
||||
#[derive(EnumString, Debug, VariantNames, IntoStaticStr, Clone)]
|
||||
#[strum(serialize_all = "kebab-case")]
|
||||
pub enum PrincipalProp {
|
||||
Resourcetype,
|
||||
CurrentUserPrincipal,
|
||||
#[strum(serialize = "principal-URL")]
|
||||
PrincipalUrl,
|
||||
#[strum(props(tagname = "C:calendar-home-set"))]
|
||||
CalendarHomeSet,
|
||||
#[strum(props(tagname = "C:calendar-user-address-set"))]
|
||||
CalendarUserAddressSet,
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use rustical_auth::AuthInfo;
|
||||
use rustical_dav::error::Error;
|
||||
use rustical_dav::{resource::Resource, xml_snippets::HrefElement};
|
||||
use serde::Serialize;
|
||||
use strum::{EnumProperty, EnumString, IntoStaticStr, VariantNames};
|
||||
use strum::{EnumString, IntoStaticStr, VariantNames};
|
||||
|
||||
pub struct RootResource {
|
||||
prefix: String,
|
||||
@@ -13,7 +13,7 @@ pub struct RootResource {
|
||||
path: String,
|
||||
}
|
||||
|
||||
#[derive(EnumString, Debug, VariantNames, EnumProperty, IntoStaticStr, Clone)]
|
||||
#[derive(EnumString, Debug, VariantNames, IntoStaticStr, Clone)]
|
||||
#[strum(serialize_all = "kebab-case")]
|
||||
pub enum RootProp {
|
||||
Resourcetype,
|
||||
|
||||
@@ -6,7 +6,7 @@ use itertools::Itertools;
|
||||
use rustical_auth::AuthInfo;
|
||||
use serde::Serialize;
|
||||
use std::str::FromStr;
|
||||
use strum::{EnumProperty, VariantNames};
|
||||
use strum::VariantNames;
|
||||
|
||||
// A resource is identified by a URI and has properties
|
||||
// A resource can also be a collection
|
||||
@@ -16,7 +16,7 @@ use strum::{EnumProperty, VariantNames};
|
||||
pub trait Resource: Sized {
|
||||
type MemberType: Resource;
|
||||
type UriComponents: Sized; // defines how the resource URI maps to parameters, i.e. /{principal}/{calendar} -> (String, String)
|
||||
type PropType: FromStr + VariantNames + Into<&'static str> + EnumProperty + Clone;
|
||||
type PropType: FromStr + VariantNames + Into<&'static str> + Clone;
|
||||
type PropResponse: Serialize;
|
||||
|
||||
async fn acquire_from_request(
|
||||
|
||||
Reference in New Issue
Block a user