Adding support for bincode Encode/Decode for a struct defined elsewhere

โš“ Rust    ๐Ÿ“… 2025-07-18    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 2      

surdeus

I have a struct that I want to use. I want to be able to Encode/Decode it using bincode. How can I add a custom function to do that?

I know for Serialize/Deserialize I can add an attribute #[serde(with = "my_serde")] and define a module with the function serialize and deserialize . I found a great source here Custom serialization ยท Serde .

However, for bincode Encode/Decode I can't find what to do.

Specifically ibe/src/kem/kiltz_vahlis_one.rs at main ยท encryption4all/ibe ยท GitHub

Any help?

10 posts - 3 participants

Read full topic

๐Ÿท๏ธ rust_feed