1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use strong_xml::{XmlRead, XmlWrite};
use crate::{__string_enum, __xml_test_suites};
#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
#[cfg_attr(test, derive(PartialEq))]
#[xml(tag = "w:fldChar")]
pub struct FieldChar {
#[xml(attr = "w:fldCharType")]
pub ty: Option<CharType>,
}
impl<T: Into<Option<CharType>>> From<T> for FieldChar {
fn from(val: T) -> Self {
FieldChar { ty: val.into() }
}
}
#[derive(Debug, Clone)]
#[cfg_attr(test, derive(PartialEq))]
pub enum CharType {
Begin,
Separate,
End,
}
__string_enum! {
CharType {
Begin = "begin",
Separate = "separate",
End = "end",
}
}
__xml_test_suites!(
FieldChar,
FieldChar::from(CharType::Begin),
r#"<w:fldChar w:fldCharType="begin"/>"#,
);