ciborium
ciborium copied to clipboard
[Feature]: AsyncRead/AsyncWrite support?
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 evenStream
?
Suggestions for a technical implementation
Having a future
feature flag to not add burden of current apps that don't need async support.
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.