nextcloud_dav/method/
depth.rs1pub const DEPTH_HEADER: &str = "Depth";
3
4#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
11pub enum Depth {
12 Zero,
14 One,
16 Infinity,
18}
19
20impl Depth {
21 pub const fn as_header_value(self) -> &'static str {
23 match self {
24 Self::Zero => "0",
25 Self::One => "1",
26 Self::Infinity => "infinity",
27 }
28 }
29}
30
31#[cfg(test)]
32mod tests {
33 use super::{DEPTH_HEADER, Depth};
34
35 #[test]
36 fn header_values_use_the_specification_tokens() {
37 assert_eq!(Depth::Zero.as_header_value(), "0");
38 assert_eq!(Depth::One.as_header_value(), "1");
39 assert_eq!(Depth::Infinity.as_header_value(), "infinity");
40 }
41
42 #[test]
43 fn header_name_keeps_its_canonical_spelling() {
44 assert_eq!(DEPTH_HEADER, "Depth");
45 }
46}