xso-proc: add support for text codecs
Text codecs allow to customize the conversion of data from/to XML, in particular in two scenarios: 1. When the type for which the behaviour is to be defined comes from a foreign crate, preventing the implementation of FromXmlText/IntoXmlText. 2. When there is not one obvious, or more than one sensible, way to convert a value to XML text and back.
This commit is contained in:
parent
46584f05f9
commit
c83ff286e0
8 changed files with 258 additions and 26 deletions
|
|
@ -280,9 +280,9 @@ impl Compound {
|
|||
State::new(state_name)
|
||||
.with_field(&bound_name, field.ty())
|
||||
.with_impl(quote! {
|
||||
::core::option::Option::Some(::xso::exports::rxml::Event::Text(
|
||||
#generator.map(|value| ::xso::exports::rxml::Event::Text(
|
||||
::xso::exports::rxml::parser::EventMetrics::zero(),
|
||||
#generator,
|
||||
value,
|
||||
))
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue