github.com/jonasbb/serde_with ↗
This crate provides custom de/serialization helpers to use in combination with serde's `with`-annotation and with the improved `serde_as`-annotation.
Open this visualization on its own page →
Contributors
28
Lines of Code
2,042
From
2017-08-17
To
2023-03-17
About jonasbb/serde_with
serde_with is a Rust crate that extends the popular serde serialization framework with custom de/serialization helpers. It provides two main approaches: integration with serde's `with` annotation and an improved `serde_as` annotation that offers greater flexibility for handling complex type structures.
The crate handles numerous practical serialization challenges. It supports de/serializing types via their Display and FromStr traits, enables arrays larger than serde's standard 32-element limit including const-generic arrays, allows skipping empty Optional fields during serialization, and can deserialize comma-separated strings into vectors. It also provides utilities for adding prefixes or suffixes to struct field names and integrates with common Rust crates through optional feature flags.
A key advantage of serde_with over raw serde is the serde_as annotation's ability to mirror the structure of nested types, making it possible to specify converters for inner types of collections and other container types. The crate is well-documented with a user guide and supports both Apache 2.0 and MIT licensing, making it suitable for integration into diverse Rust projects.