Skip to content

Releases: anza-xyz/wincode

v0.2.2

04 Dec 20:11
63ae59c

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.2.1...v0.2.2

v0.2.1

26 Nov 21:19
9853c66

Choose a tag to compare

What's Changed

  • Fix alloc import when only alloc feature enabled

Full Changelog: v0.2.0...v0.2.1

v0.2.0

26 Nov 15:21
e6b09f9

Choose a tag to compare

Release Notes

This release introduces compile-time type metadata that enables optimized serialization and deserialization of types with compile-time known sizes, dramatically improving performance while simplifying the API surface. It also adds additional I/O helpers, more built-in type support, and flexible enum encoding options.

Compile-time Type Metadata (TypeMeta)

A major new addition: SchemaRead and SchemaWrite now expose a TypeMeta constant that describes a type's serialized size and zero-copy capability.

Types are classified as one of:

  • Dynamic: variable length (e.g. Vec<T>, Box<[T]>)
  • Static: fixed size but non-zero-copy
  • Zero-copy: fixed size, directly serializable from memory

This metadata allows us to:

  • Prefetch and bounds-check entire contiguous read/write chunks for Static aggregates, eliding intermediate bounds checks for those chunks.
  • Optimize composite and container type implementations without manual Pod annotations.

SchemaRead and SchemaWrite derive macros will automatically generate this metadata for your types.

In microbenchmarks, types qualifying for TypeMeta::Static and collections containing TypeMeta::Static types show 6–10× faster serialization and deserialization over v0.1.x.

Reader/Writer Refactor

Reader and Writer are now traits rather than concrete types.

This enables multiple I/O backends (slice, Cursor, Vec, etc.) and allows implementing trusted (bounds-check-elided) variants where subsets of the serialization / deserialization targets have compile-time known sizes.

Breaking Change

SchemaRead and SchemaWrite now take impl Reader / impl Writer instead of concrete types.

Automatic Pod Inference & Deprecation of Elem

The new compile-time metadata makes manual annotation with Pod unnecessary in most cases:

Collections like Vec<T> or Box<[T]> now infer Pod automatically

  • Elem is deprecated (still supported as a transparent pass-through for backwards compatibility)
  • This drastically reduces boilerplate while ensuring optimal serialization behavior by default.

Enum Configurability & TypeMeta Inference

Enums will be qualified as TypeMeta::Static if all variants share equal serialized size, unlocking significant performance improvements for unit enums and enums with equal sized variants.

Custom Discriminant Encodings

Enums can now specify how their discriminants are encoded:

#[wincode(tag_encoding = "u8")]
enum Example { A, B }

Custom Variant Tags

Enums can now specify custom discriminant expressions for variants:

enum Enum {
    #[wincode(tag = 1)]
    A { name: String, id: u64 },
    #[wincode(tag = 2)]
    B(String, Vec<u8>),
    #[wincode(tag = 3)]
    C,
}

Expanded Type Support

Added built-in implementations:

  • f32
  • f64
  • Result<T, E>

Error Handling

  • ReadError and WriteError now support custom error variants.
  • io::ReadError and io::WriteError now support std::io::Error when the std feature is enabled.

Commits

New Contributors

Full Changelog: v0.1.2...v0.2.0

v0.1.2

13 Oct 17:02
2cbcbf0

Choose a tag to compare

What's Changed

  • Implement specialization for contiguous byte structures by @cpubot in #7
  • Add SchemaRead impl for &'de [u8] by @cpubot in #8
  • Removed a redundant statement in readme by @deepesh-sr in #11
  • Overhaul tuple macro to use a drop guard by @cpubot in #9
  • Documentation improvements by @cpubot in #12

New Contributors

Full Changelog: v0.1.1...v0.1.2

wincode v0.1.1

13 Oct 17:01
e0dea9f

Choose a tag to compare

What's Changed

  • Make #[derive(SchemaRead)] less brittle with generic lifetimes by @cpubot in #4
  • doc_auto_cfg was merged into doc_cfg by @cpubot in #5

Full Changelog: https://github.com/anza-xyz/wincode/commits/v0.1.1