msgpack-rust icon indicating copy to clipboard operation
msgpack-rust copied to clipboard

Is there way to serialize nanosecond precision ext type?

Open cosmo0920 opened this issue 7 years ago • 6 comments

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?

cosmo0920 avatar Feb 01 '17 09:02 cosmo0920

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?

3Hren avatar Feb 01 '17 14:02 3Hren

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.

cosmo0920 avatar Feb 01 '17 14:02 cosmo0920

serde is too frequent to update for me.

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

dtolnay avatar Feb 01 '17 15:02 dtolnay

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.

cosmo0920 avatar Feb 02 '17 02:02 cosmo0920

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.

dtolnay avatar Feb 02 '17 02:02 dtolnay

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.

cosmo0920 avatar Mar 03 '17 08:03 cosmo0920