forked from tafia/quick-xml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCargo.toml
114 lines (100 loc) · 3.44 KB
/
Cargo.toml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
[package]
name = "quick-xml"
version = "0.23.0"
description = "High performance xml reader and writer"
edition = "2018"
documentation = "https://docs.rs/quick-xml"
repository = "https://github.com/tafia/quick-xml"
keywords = ["xml", "serde", "parser", "writer", "html"]
categories = ["encoding", "parsing", "parser-implementations"]
license = "MIT"
[dependencies]
document-features = { version = "0.2", optional = true }
encoding_rs = { version = "0.8", optional = true }
serde = { version = "1.0", optional = true }
memchr = "2.5"
[dev-dependencies]
criterion = "0.3"
pretty_assertions = "1.2"
regex = "1"
serde = { version = "1.0", features = ["derive"] }
serde-value = "0.7"
[[bench]]
name = "bench"
harness = false
[features]
default = []
## Enables support of non-UTF-8 encoded documents. Encoding will be inferred from
## the XML declaration if it will be found, otherwise UTF-8 is assumed.
##
## Currently, only ASCII-compatible encodings are supported, so, for example,
## UTF-16 will not work (therefore, `quick-xml` is not [standard compliant]).
##
## List of supported encodings includes all encodings supported by [`encoding_rs`]
## crate, that satisfied the restriction above.
##
## [standard compliant]: https://www.w3.org/TR/xml11/#charencoding
encoding = ["encoding_rs"]
## This feature enables support for deserializing lists where tags are overlapped
## with tags that do not correspond to the list.
##
## When this feature is enabled, the XML:
## ```xml
## <any-name>
## <item/>
## <another-item/>
## <item/>
## <item/>
## </any-name>
## ```
## could be deserialized to a struct:
## ```ignore
## #[derive(Deserialize)]
## #[serde(rename_all = "kebab-case")]
## struct AnyName {
## item: Vec<()>,
## another_item: (),
## }
## ```
##
## When this feature is not enabled (default), only the first element will be
## associated with the field, and the deserialized type will report an error
## (duplicated field) when the deserializer encounters a second `<item/>`.
##
## Note, that enabling this feature can lead to high and even unlimited memory
## consumption, because deserializer should check all events up to the end of a
## container tag (`</any-name>` in that example) to figure out that there are no
## more items for a field. If `</any-name>` or even EOF is not encountered, the
## parsing will never end which can lead to a denial-of-service (DoS) scenario.
##
## Having several lists and overlapped elements for them in XML could also lead
## to quadratic parsing time, because the deserializer must check the list of
## events as many times as the number of sequence fields present in the schema.
##
## To reduce negative consequences, always [limit] the maximum number of events
## that [`Deserializer`] will buffer.
##
## This feature works only with `serialize` feature and has no effect if `serialize`
## is not enabled.
##
## [limit]: crate::de::Deserializer::event_buffer_size
## [`Deserializer`]: crate::de::Deserializer
overlapped-lists = []
## Enables support for [`serde`] serialization and deserialization
serialize = ["serde"]
## Enables support for recognizing all [HTML 5 entities](https://dev.w3.org/html5/html-author/charref)
escape-html = []
[package.metadata.docs.rs]
all-features = true
[[test]]
name = "serde_attrs"
required-features = ["serialize"]
[[test]]
name = "serde_roundtrip"
required-features = ["serialize"]
[[test]]
name = "serde-de"
required-features = ["serialize"]
[[test]]
name = "serde-migrated"
required-features = ["serialize"]