work on errors

This commit is contained in:
Lennart
2024-03-15 21:29:21 +01:00
parent ebf826f5b0
commit 1221a3cba1
10 changed files with 28 additions and 17 deletions

View File

@@ -1,3 +1,4 @@
use crate::{error::Error, xml_snippets::TagList};
use actix_web::{http::StatusCode, HttpRequest};
use anyhow::{anyhow, Result};
use async_trait::async_trait;
@@ -7,8 +8,6 @@ use serde::Serialize;
use std::str::FromStr;
use strum::{EnumProperty, VariantNames};
use crate::xml_snippets::TagList;
// A resource is identified by a URI and has properties
// A resource can also be a collection
// A resource cannot be none, only Methods like PROPFIND, GET, REPORT, etc. can be exposed
@@ -25,7 +24,7 @@ pub trait Resource: Sized {
auth_info: AuthInfo,
uri_components: Self::UriComponents,
prefix: String,
) -> Result<Self>;
) -> Result<Self, Error>;
fn get_path(&self) -> &str;
async fn get_members(&self) -> Result<Vec<Self::MemberType>>;