Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sonic_rs::to_{writer, writer_pretty} over arbitrary I/O writers #54

Open
Tracked by #66
aumetra opened this issue Jan 3, 2024 · 1 comment · May be fixed by #87
Open
Tracked by #66

sonic_rs::to_{writer, writer_pretty} over arbitrary I/O writers #54

aumetra opened this issue Jan 3, 2024 · 1 comment · May be fixed by #87
Assignees
Labels
C-enhancement This is a PR that adds a new feature or fixes a bug.

Comments

@aumetra
Copy link

aumetra commented Jan 3, 2024

Is your feature request related to a problem? Please describe.

It would be great if the sonic_rs::to_{writer, writer_pretty} could be used with arbitrary I/O writers.
In particular, I'm attempting to implement a trait which only receives an io::Write type and I would like to serialize the JSON directly into the writer without any intermediate buffering.

Describe the solution you'd like

Any type that implements std::io::Writer can be used with sonic_rs::to_{writer, writer_pretty}

Describe alternatives you've considered

Write a wrapper struct that implements WriteExt but I'm not sure how to implement the trait for arbitrary writers

@liuq19
Copy link
Collaborator

liuq19 commented Jan 4, 2024

Thanks, maybe we need GrowedBufWriter<W: Write> as a wrapper with WriteExt trait to fix the problem?

We will investigate it

@liuq19 liuq19 self-assigned this Jan 4, 2024
@liuq19 liuq19 added the C-enhancement This is a PR that adds a new feature or fixes a bug. label Jan 4, 2024
@liuq19 liuq19 mentioned this issue Apr 9, 2024
9 tasks
@aumetra aumetra linked a pull request May 26, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement This is a PR that adds a new feature or fixes a bug.
Development

Successfully merging a pull request may close this issue.

2 participants