-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Is there an existing issue for this?
- I have searched the existing issues
Description
The CBOR RFC specifies that CBOR can be used in streaming applications:
In a streaming application, a data stream may be composed of a sequence of CBOR data items concatenated back-to-back. In such an environment, the decoder immediately begins decoding a new data item if data is found after the end of a previous data item.
I would like to use this in my program jaq, where I have already integrated support for CBOR via ciborium_ll. However, I have hit the limitation that ciborium_ll::Decoder::pull does not allow me to distinguish between EOF and syntax errors. As a result, I have not found a way to properly support CBOR streaming in my application.
Acceptance Criteria
No response
Suggestions for a technical implementation
I see two realistic options:
- Create a version of
Decoder::pull()that returnsOption<Result<Header, Error<R::Error>>>instead ofResult<Header, Error<R::Error>>. We could call this functionnext()and then also just implementIteratorforDecoder. :) - Enhance the
ciborium_ll::Errortype with anEofvariant.
If you give me a green light for one of these two options, I would be also motivated to implement this change myself.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status