quininer / cbor4ii

CBOR: Concise Binary Object Representation
MIT License
54 stars 5 forks source link

core: tag parsing without value #22

Closed vmx closed 2 years ago

vmx commented 2 years ago

It's not easily possible to parse a tag without the value with the current public API. This commit introduces a TagStart, which is similar to ArrayStart and MapStart. It only parses the tag into a u64, without advancing to the value.

This is the API I came up with, as always, if there's a better way to solve my problem of parsing a tag value with the current public API, I'm happy to hear about it.

quininer commented 2 years ago

I don't like the TagStart API, and frankly neither do I like ArrayStart and MapStart, but they are needed to implement serde. so if it's useful, I'm not against add it.

If we can't think of a better API, maybe in next version, we can put these easily abused methods into separate mod.

Thank you.

vmx commented 2 years ago

Thank you for merging it though, I'll think about a better API. May I request yet another release? This should hopefully be the last one I need to request, we are close to do a release of our library based on cbor4ii (switching from serde_cbor). From then on there should be less urgency and I can just move with the speed you naturally do releases.

quininer commented 2 years ago

I will release it later. :)