ciborium icon indicating copy to clipboard operation
ciborium copied to clipboard

[Feature]: AsyncRead/AsyncWrite support?

Open Schniz opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

Right now, all the functions support Read and Write traits. When using async Rust, it would probably be better to support AsyncRead and AsyncWrite. I wonder if that's something you'll be willing to accept.

We can obviously feature flag this, and make it experimental at first. But I wanted to know what you think.

Acceptance Criteria

  • Supporting AsyncRead implementations in ciborium
  • Supporting AsyncRead in ciborium-ll, or even Stream?

Suggestions for a technical implementation

Having a future feature flag to not add burden of current apps that don't need async support.

Schniz avatar Jun 12 '23 18:06 Schniz

Serde doesn't have a mechanism for restarting once an error has happened, so supporting async traits for the serde portion of the library doesn't make sense. For the low level library, I think it would be sufficient for it to work on &[u8], since the library doesn't block in any other way.

ahmedcharles avatar Feb 20 '24 08:02 ahmedcharles