Skip to content

Add support for writing to embedded_io::Write#80

Open
elrafoon wants to merge 2 commits into
rust-embedded-community:masterfrom
elrafoon:embedded_io
Open

Add support for writing to embedded_io::Write#80
elrafoon wants to merge 2 commits into
rust-embedded-community:masterfrom
elrafoon:embedded_io

Conversation

@elrafoon

Copy link
Copy Markdown
Contributor

Hello,

I think this feature is quite useful for many users.

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

@elrafoon

Copy link
Copy Markdown
Contributor Author

Dear maintainers, is there any problem with this one?

@eldruin eldruin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR.
I am not familiar enough with this crate to judge these changes, though.
Maybe @jordens has an opinion?

@jordens

jordens commented Feb 1, 2024

Copy link
Copy Markdown
Contributor
  • 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.

@ryan-summers

Copy link
Copy Markdown
Member

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?

@elrafoon

elrafoon commented Feb 17, 2024

Copy link
Copy Markdown
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants