Closed RuofengX closed 8 months ago
Typed-sled use derive marco of serde, which could derive the chrone::Datetime successfully.
For interop with bincode’s derive feature, you can use the
#[bincode(with_serde)]
attribute on each field that implements serde’s traits.
https://docs.rs/bincode/2.0.0-rc.3/bincode/serde/index.html
Would this work?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I am writing a typed wrapper for sled database using bincode-2.0.0-rc3 based on the typed-sled which use bincode-1 to do the codec thing.
When I writing the example part of
bincode-sled
, I found that a struct which containschrono::DateTime<chrono::Utc>
cannot auto-derive the Encode and Decode trait, I could only turn to using a SystemTime as a work around.source code is here