Quickstart with wincode derive macros
masterTo use wincode with your own custom struct types, use the SchemaWrite and SchemaRead derive macros. This allows you to perform fast, in-place serialization and deserialization that is compatible with bincode.
Ensure you have the derive feature enabled in your Cargo.toml to use these macros.
#[derive(SchemaWrite, SchemaRead)]
struct MyStruct {
data: Vec<u64>,
win: bool,
}
let val = MyStruct { data: vec![1,2,3], win: true };
// wincode serialization is compatible with bincode
assert_eq!(wincode::serialize(&val).unwrap(), bincode::serialize(&val).unwrap());