I’m stuck upon a problem I can’t solve.
I’m using Rocket framework which requires serde/serde_derive < 1.0 and I also need chrono package who needs serde > 1.0.
Whatever I do I’m alwasy getting errors aboud missing trait implementation since those were moved/change while serde was getting stable release.
For example - with serde <1.0 I’m getting a lot of following errors:
--> src/gpon.rs:34:16 | 34 | #[derive(Debug,Serialize,Deserialize)] | ^^^^^^^^^ the trait `serde::Serialize` is not implemented for `chrono::DateTime<chrono::UTC>` | = note: required by `serde::ser::SerializeStruct::serialize_field`
When makeing upgrade to satisfy chrono I’m getting errors from Rocket code:
--> src/main.rs:108:1 |108 | #[post("/makexml/<sn>", data="<values>")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `serde::de::Deserialize` is not implemented for `nccrest::pppoe::PPPoECredentials` | = note: required because of the requirements on the impl of `rocket::data::FromData` for `rocket_contrib::JSON<rest::pppoe::PPPoECredentials>` = note: required because of the requirements on the impl of `rocket::data::FromData` for `std::result::Result<rocket_contrib::JSON<rest::pppoe::PPPoECredentials>, rocket_contrib::Error>`
When using head version of rocket.rs I’m getting another pile of erros regarding different Cookies implmentation…
Is there a way to tell compiler to use different libraries in different source .rs files so I can use [#[derive(Serialize,Deserialize)] either from serde 0.9. or 1.* ??
This kinds of errors still makes rust hard to use in production - way too many breaking changes everywhere.
But this one is beyond my skills to fix