serde-json-core icon indicating copy to clipboard operation
serde-json-core copied to clipboard

Add support for writing to embedded_io::Write

Open elrafoon opened this issue 1 year ago • 4 comments
trafficstars

Hello,

I think this feature is quite useful for many users.

It's feature-gated, so shall be harmless for others.

elrafoon avatar Jan 20 '24 18:01 elrafoon

Dear maintainers, is there any problem with this one?

elrafoon avatar Jan 31 '24 17:01 elrafoon

  • I'm worried by the dyn SerializerBackend. serde_json::Serializer is just generic over io::Write. That would be better.
  • It's missing the analogous Deserializer changes.

jordens avatar Feb 01 '24 10:02 jordens

I'm not sure I fully understand the use case. Can you provide a small example of what you're looking to do in code that this enables?

ryan-summers avatar Feb 01 '24 12:02 ryan-summers

In meantime I got better idea. We could add our own Read and Write traits, and then implement those traits for embedded_io::{Read, Write}. Serializer would be generic over Read and Deserializer over Write.

It would look like here

elrafoon avatar Feb 17 '24 07:02 elrafoon