DAV Push: Add supported-triggers

This commit is contained in:
Lennart
2025-05-02 20:43:58 +02:00
parent 630a4600c2
commit 6330021f05
5 changed files with 54 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
use actix_web::{http::StatusCode, FromRequest, HttpRequest, ResponseError};
use futures_util::future::{err, ok, Ready};
use actix_web::{FromRequest, HttpRequest, ResponseError, http::StatusCode};
use futures_util::future::{Ready, err, ok};
use rustical_xml::ValueSerialize;
use thiserror::Error;
#[derive(Error, Debug)]
@@ -12,13 +13,24 @@ impl ResponseError for InvalidDepthHeader {
}
}
#[derive(Debug, PartialEq)]
#[derive(Debug, Clone, PartialEq)]
pub enum Depth {
Zero,
One,
Infinity,
}
impl ValueSerialize for Depth {
fn serialize(&self) -> String {
match self {
Depth::Zero => "0",
Depth::One => "1",
Depth::Infinity => "Infinity",
}
.to_owned()
}
}
impl TryFrom<&[u8]> for Depth {
type Error = InvalidDepthHeader;