3Hren / msgpack-rust

MessagePack implementation for Rust / msgpack.org[Rust]
MIT License
1.1k stars 124 forks source link

Is there way to serialize nanosecond precision ext type? #98

Open cosmo0920 opened 7 years ago

cosmo0920 commented 7 years ago

Fluentd v0.14 implements EventTime extension type: https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1#eventtime-ext-format Is there way to handle this on rmp-serialize crate?

3Hren commented 7 years ago

Currently no. It can be customized using some kind of ExtVisitor, give me a day.

BTW is there a reason to use rustc-serialize instead of serde?

cosmo0920 commented 7 years ago

Currently no. It can be customized using some kind of ExtVisitor, give me a day.

Thanks, I'm looking forward this feature.

BTW is there a reason to use rustc-serialize instead of serde?

serde is too frequent to update for me. But I know this one is more recommended crate than rustc-serialize.

dtolnay commented 7 years ago

serde is too frequent to update for me.

Thanks for the feedback @cosmo0920. What frequency of updates would you be more comfortable with?

cosmo0920 commented 7 years ago

serde is too frequent to update for me.

Thanks for the feedback @cosmo0920. What frequency of updates would you be more comfortable with?

At first, I don't want to slow down serde release life cycle. I feel that serde often had used feature-gated rust functionality in code generating. This feature-gated functionality is already replaced with macros 1.1? Otherwise, there is no uncomfortable things for me.

dtolnay commented 7 years ago

Thanks for the details. The feature-gated functionality is replaced by macros 1.1 and is stable as of Rust 1.15, which will be released tomorrow February 2. Starting tomorrow, Serde will be 100% stable and rustc-serialize will be 100% deprecated and abandoned. Most major crates (toml, bincode and others) will be dropping support for rustc-serialize in their next release so now would be the time to migrate.

I encourage you to try Serde again and I guarantee it will be stable unlike your previous experience.

cosmo0920 commented 7 years ago

Is there way to handle this on rmp-serialize crate?

Thanks to @dtolnay 's encouragement, I've succeeded to migrate my crate to use serde from rustc-serialize. So, I want to serialize Tm like struct as EventTime with rmp-serde instead of rmp-serialize, now.