serde icon indicating copy to clipboard operation
serde copied to clipboard

Customizable buffer type (proof of concept)

Open dtolnay opened this issue 8 months ago • 5 comments

This demonstrates a backward compatible way that a format such as serde_json could use its own serde_json::Value as its buffer type for untagged enums and flatten, instead of "Content", solving https://github.com/serde-rs/serde/issues/1183. Uses "return position impl trait in traits" (stabilized in Rust 1.75 by https://github.com/rust-lang/rust/pull/115822) and "precise capturing in traits" (stabilized in Rust 1.87 by https://github.com/rust-lang/rust/pull/138128).

dtolnay avatar Mar 22 '25 22:03 dtolnay

This would be WONDERFUL, thank you @dtolnay for exploring it <3

juntyr avatar Mar 23 '25 07:03 juntyr

I hope, that before landing this, you will look at least an one implementation for a format other than JSON-like. I can help with testing this approach in quick-xml.

Mingun avatar Mar 23 '25 12:03 Mingun

I'm a maintainer for RON and we'd also be very interested

juntyr avatar Mar 23 '25 13:03 juntyr

@dtolnay We just had another bug report in RON that we cannot fix because of not being able to customize the content/buffer type. Since precise capturing in traits was released in 1.87, would you be able to take another look at this PR?

juntyr avatar Jul 24 '25 06:07 juntyr

Any progress here?

radu-byte avatar Oct 13 '25 09:10 radu-byte