Ingvar Stepanyan
Ingvar Stepanyan
@oli-obk I mean to avoid any annotations and instead use prefixes for struct fields (which is essentially the same, just perhaps more convenient).
Maybe... although author can still add annotations to rename it if it's a public structure / fields and not just for internal usage.
@mdashti serde-xml-rs definitely didn't support that format, it's rather because it switched from serde-xml to serde-xml-rs in rust-s3 in https://github.com/durch/rust-s3/commit/2f684e28b8750fb9b5ea44572c95935d918d73f7
Currently you need to describe e.g. tuple `PlainText(String)` to parse it.
Interesting. Does enum not work for these cases? (where all attributes and $value are fields of variants)
Ah yeah, this might work too, wasn't sure about performance implications of intermediate types compared to series of calls though. As for implementing this - I guess I can as...
Actually, the way you suggested should be much easier to implement than mine, I'll give it a shot next week unless you want to try earlier.
@dtolnay When I was playing with this idea locally, for `serialize_element` I was assuming `Serialize` is already implemented (in fact, the entire point why I needed this macro is for...
One problem with auto-generating types as above though is generating "random" identifiers for them - as far as I know, there is no easy way to do that in Rust...
Btw, for sequences (static JSON arrays) we could convert them to tuples of references instead of temporary named structure types; in that case, `Serialize` is already implemented and we can...