Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Parsing and Emitting Tags #3

Closed
vooon opened this issue Feb 6, 2016 · 8 comments
Closed

Parsing and Emitting Tags #3

vooon opened this issue Feb 6, 2016 · 8 comments

Comments

@vooon
Copy link

vooon commented Feb 6, 2016

Hello. I'm what to emit Tag(0) (RFC 3339 date-time string), but i can't find any hints.

@pyfisch
Copy link
Owner

pyfisch commented Feb 7, 2016

It is currently not possible because serde does not support serializing and deserializing tags. If you need it I will propose a PR to serde to add this function.

@vooon
Copy link
Author

vooon commented Feb 7, 2016

Thank you. But for my "hello world" class project easier to use go or even c11.

@vooon vooon closed this as completed Feb 7, 2016
@dignifiedquire
Copy link

@pyfisch I'm looking into using this for an implementation, but I will need to be able to use custom tags. How far of is that? Or should I just use http://burntsushi.net/rustdoc/cbor/ for now, which already implements handling of custom tags, though as I'm using serde_json already in other parts I'd really like to use serde_cbor.

@pyfisch pyfisch reopened this Mar 15, 2016
@pyfisch
Copy link
Owner

pyfisch commented Mar 30, 2016

Adding support for tags to serde_cbor requires support from the serde crate. There is already an issue about adding adding tags to serde: serde-rs/serde/issues/163 but it has not yet been decided how the support should look like. Tags are specific to serializiation formats and for this reason it is hard to handle them in a generic serializiation framework.

@erickt Do you have any ideas about this?

@dignifiedquire Yes probably you should use burntsushis cbor implementation for now.

@pyfisch pyfisch changed the title How to emit Tag(0) on encoding Parsing and Emitting Tags Mar 30, 2016
@pyfisch pyfisch mentioned this issue Sep 16, 2017
@dvc94ch
Copy link

dvc94ch commented Feb 23, 2019

Any news on this?

@pyfisch
Copy link
Owner

pyfisch commented Mar 2, 2019

Nope, if this should be done well it needs some help from serde. Currently there is a lot of work going on related to no-std compatibility and I plan to generally polish the crate. When this is finished tags can be discussed again.

@sfackler
Copy link
Collaborator

sfackler commented Mar 2, 2019

This may need to wait for specialization, where this crate could define subtraits of Serializer/Deserializer/etc that provide extra methods to interact with tags. Serialize/Deserialize implementations could then specialize for that subtrait to interact with the extra functionality.

@petreeftime
Copy link

I'm also interested in tagging. I would like to implement a COSE library [https://tools.ietf.org/html/rfc8152], but that requires tags. https://github.com/BurntSushi/rust-cbor suggests using this crate, since that one is unmaintained, but this one doesn't have tags.

SerDe seems stuck on tagging due to missing specialization support: serde-rs/serde#455. Do you think adding some extra tagging API to this crate in the interim could make this work?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants