diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-03-01 17:17:51 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-03-01 17:17:51 +0100 |
commit | dee970afe5db1886b3e1816703ef841acbd07463 (patch) | |
tree | cfc0f7a93a439875e46bd0d0805cb0a6d78252de /src/dav/types.rs | |
parent | 77e2f8abbb2d70413ba571baf405f10572299fd9 (diff) | |
download | aerogramme-dee970afe5db1886b3e1816703ef841acbd07463.tar.gz aerogramme-dee970afe5db1886b3e1816703ef841acbd07463.zip |
type refactor on <prop>
Diffstat (limited to 'src/dav/types.rs')
-rw-r--r-- | src/dav/types.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/dav/types.rs b/src/dav/types.rs index 55e9e86..4487de7 100644 --- a/src/dav/types.rs +++ b/src/dav/types.rs @@ -372,10 +372,12 @@ pub struct Owner { /// text or mixed content. /// /// <!ELEMENT prop ANY > -pub enum Prop<T: Extension> { - Name(Vec<PropertyRequest<T>>), - Value(Vec<Property<T>>), +pub enum AnyProp<T: Extension> { + Name(PropName<T>), + Value(PropValue<T>), } +pub struct PropName<T: Extension>(pub Vec<PropertyRequest<T>>); +pub struct PropValue<T: Extension>(pub Vec<Property<T>>); /// 14.19. propertyupdate XML Element /// @@ -387,7 +389,7 @@ pub enum Prop<T: Extension> { /// required to modify the properties on the resource. /// /// <!ELEMENT propertyupdate (remove | set)+ > -pub struct PropertyUpdate<T: Extension>(Vec<PropertyUpdateItem<T>>); +pub struct PropertyUpdate<T: Extension>(pub Vec<PropertyUpdateItem<T>>); pub enum PropertyUpdateItem<T: Extension> { Remove(Remove<T>), Set(Set<T>), @@ -430,7 +432,7 @@ pub enum PropertyUpdateItem<T: Extension> { pub enum PropFind<T: Extension> { PropName, AllProp(Option<Include<T>>), - Prop(Vec<PropertyRequest<T>>), + Prop(PropName<T>), } @@ -451,7 +453,7 @@ pub enum PropFind<T: Extension> { /// /// <!ELEMENT propstat (prop, status, error?, responsedescription?) > pub struct PropStat<T: Extension> { - pub prop: Prop<T>, + pub prop: AnyProp<T>, pub status: Status, pub error: Option<Error<T>>, pub responsedescription: Option<ResponseDescription>, @@ -470,7 +472,7 @@ pub struct PropStat<T: Extension> { /// the names of properties to be removed are required. /// /// <!ELEMENT remove (prop) > -pub struct Remove<T: Extension>(pub Prop<T>); +pub struct Remove<T: Extension>(pub PropName<T>); /// 14.24. response XML Element /// @@ -535,7 +537,7 @@ pub struct ResponseDescription(pub String); /// property, and MUST be subsequently retrievable using PROPFIND. /// /// <!ELEMENT set (prop) > -pub struct Set<T: Extension>(pub Prop<T>); +pub struct Set<T: Extension>(pub PropValue<T>); /// 14.27. shared XML Element /// |