Refactoring: Lots of fixes still necessary to get it into a working state

This commit is contained in:
Lennart
2024-05-25 22:00:09 +02:00
parent 35acfe1575
commit 7a0a91f823
14 changed files with 470 additions and 223 deletions

View File

@@ -13,8 +13,8 @@ use strum::VariantNames;
// A resource cannot be none, only Methods like PROPFIND, GET, REPORT, etc. can be exposed
// A resource exists
#[async_trait(?Send)]
pub trait Resource: Sized {
type MemberType: Resource;
pub trait OldResource: Sized {
type MemberType: OldResource;
type UriComponents: Sized; // defines how the resource URI maps to parameters, i.e. /{principal}/{calendar} -> (String, String)
type PropType: FromStr + VariantNames + Into<&'static str> + Clone;
type PropResponse: Serialize;
@@ -66,7 +66,7 @@ pub trait HandlePropfind {
fn propfind(&self, props: Vec<&str>) -> Result<impl Serialize>;
}
impl<R: Resource> HandlePropfind for R {
impl<R: OldResource> HandlePropfind for R {
fn propfind(&self, props: Vec<&str>) -> Result<impl Serialize> {
let mut props = props.into_iter().unique().collect_vec();
if props.contains(&"allprops") {