Skip to content

Encoding to std::io::Write? #258

@RandomInsano

Description

@RandomInsano

I'm providing data directly to a socket. It looks like encode() writes to std::fmt::Write so it must be written to buffer then sent to the socket.

That's serviceable, but seems like a bit of a waste of memory and performance. So, two questions:

  1. Is there a way to write to std::io::Write that I haven't seen? Reviewing the text encoder, it seems like no
  2. Is there any interest in a pull request that would implement this? Maybe as encode_stream() and hide that behind the existing encode() and friends?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions