rust-protobuf
rust-protobuf copied to clipboard
Add Hash for SpecialFields , in order to enable derive hash in…
messag in CustomizeCallback during codegen
following https://github.com/stepancheg/rust-protobuf/issues/211 , I tried to implement Hash and Eq with CustomizeCallback but i need Hash to be implement on SpecialFields (and some other structs) . In hash I don't have something equivalent to #[serde(skip)] like in the example in the serde example
Added hash to SpecialFields in 6890eba9dbcfb39c09961d800ab56aa894f39243, but Timestamp is generated, it should not be changed manually.
So if I have proto object that include well-known type and I need to implement hash on this object .
what I need to do is to fetch the proto definition from google , and do my customize code generation also on google proto ?
Rust-protobuf can be patched to derive Hash for well-known types.
But well known types are generated. Generator need to be patched to patch these files. With some local hack.
Resulting change is correct. But it would be overwritten on next code regeneration if generator is not patched.
cool , thanks !