@@ -8,13 +8,14 @@ documentation = "https://docs.rs/quick-xml"
88repository = " https://github.com/tafia/quick-xml"
99
1010keywords = [" xml" , " serde" , " parser" , " writer" , " html" ]
11- categories = [" encoding" , " parsing" , " parser-implementations" ]
11+ categories = [" asynchronous " , " encoding" , " parsing" , " parser-implementations" ]
1212license = " MIT"
1313
1414[dependencies ]
1515document-features = { version = " 0.2" , optional = true }
1616encoding_rs = { version = " 0.8" , optional = true }
1717serde = { version = " 1.0" , optional = true }
18+ tokio = { version = " 1.20" , optional = true , default-features = false , features = [" io-util" ] }
1819memchr = " 2.5"
1920
2021[dev-dependencies ]
@@ -23,6 +24,8 @@ pretty_assertions = "1.2"
2324regex = " 1"
2425serde = { version = " 1.0" , features = [" derive" ] }
2526serde-value = " 0.7"
27+ tokio = { version = " 1.20" , default-features = false , features = [" macros" , " rt" ] }
28+ tokio-test = " 0.4"
2629
2730[lib ]
2831bench = false
@@ -37,6 +40,13 @@ harness = false
3740
3841[features ]
3942default = []
43+
44+ # # Enables support for asynchronous reading from `tokio`'s IO-Traits by enabling
45+ # # [reading events] from types implementing [`tokio::io::AsyncBufRead`].
46+ # #
47+ # # [reading events]: crate::reader::Reader::read_event_into_async
48+ async-tokio = [" tokio" ]
49+
4050# # Enables support of non-UTF-8 encoded documents. Encoding will be inferred from
4151# # the XML declaration if it will be found, otherwise UTF-8 is assumed.
4252# #
@@ -123,3 +133,7 @@ required-features = ["serialize"]
123133[[test ]]
124134name = " serde-migrated"
125135required-features = [" serialize" ]
136+
137+ [[test ]]
138+ name = " async-tokio"
139+ required-features = [" async-tokio" ]
0 commit comments