webdav_xml/properties/
getcontentlanguage.rs1use bytestring::ByteString;
6
7use crate::{Element, Error, Value, DAV_NAMESPACE, DAV_PREFIX};
8
9#[derive(Clone, Debug, PartialEq)]
12pub struct ContentLanguage(pub ByteString);
13
14impl Element for ContentLanguage {
15 const NAMESPACE: &'static str = DAV_NAMESPACE;
16 const PREFIX: &'static str = DAV_PREFIX;
17 const LOCAL_NAME: &'static str = "getcontentlanguage";
18}
19
20impl TryFrom<&Value> for ContentLanguage {
21 type Error = Error;
22
23 fn try_from(value: &Value) -> Result<Self, Self::Error> {
24 Ok(Self(value.to_str()?.clone()))
25 }
26}
27
28impl From<ContentLanguage> for Value {
29 fn from(ContentLanguage(s): ContentLanguage) -> Value {
30 Value::Text(s)
31 }
32}