so trying serialize struct using bincode following these instructions, , able work.
but wanted serialize struct ipaddr
enum. since ipaddr
doesn't implement encodable
trait needed, downloaded rustc_serialize crate git , implemented encodable ipaddr
myself. changed cargo.toml
file to:
[dependencies] # rustc-serialize = "0.3" byteorder = "0.3" bincode = "0.4" [dependencies.rustc-serialize] path = "src/rustc-serialize-master"
but now, same code struct using doesn't compile saying rustc_serialize::serialize::encodable
not implemented struct though have #[derive(rustcencodable)]
above struct.
even when rid of code added local version of rustc_serialize, still error.
i think might due being screwed way bincode , local rustc_serialize interact, i'm not sure.
please review cargo documentation on overriding dependencies:
to specify overrides, create
.cargo/config
file in ancestor of project's directory (common places put in root of code directory or in home directory).inside file, put this:
paths = ["/path/to/project/rand"]
going deeper, running issue 22750 - 2 different versions of crate interacting leads unhelpful error messages. when add rustc-serialize dependencies
, aren't replacing old version, adding new one.
in general, feature. if project relies on crates , b , both rely on crate z different versions, rust can handle fine. problem arises when re-export items crates.
Comments
Post a Comment