@@ -200,6 +200,13 @@ assert!(!(StructExample <= StructExample));
200200Note that it is not possible to use ` incomparable ` with [ ` Eq ` ] or [ ` Ord ` ] as
201201that would break their invariants.
202202
203+ ### Serde ` Deserialize ` and ` Serialize `
204+
205+ Deriving [ ` Deserialize ` ] and [ ` Serialize ` ] works as expected. While
206+ derive-where does not offer any attribute options, regular ` serde ` attributes
207+ can be used. Derive-where will respect
208+ [ ` #[serde(crate = "...")] ` ] ( https://serde.rs/container-attrs.html#crate ) .
209+
203210### ` Zeroize ` options
204211
205212` Zeroize ` has two options:
@@ -259,11 +266,13 @@ The following traits can be derived with derive-where:
259266- [ ` Copy ` ]
260267- [ ` Debug ` ]
261268- [ ` Default ` ]
269+ - [ ` Deserialize ` ] : Only available with the ` serde ` crate feature.
262270- [ ` Eq ` ]
263271- [ ` Hash ` ]
264272- [ ` Ord ` ]
265273- [ ` PartialEq ` ]
266274- [ ` PartialOrd ` ]
275+ - [ ` Serialize ` ] : Only available with the ` serde ` crate feature.
267276- [ ` Zeroize ` ] : Only available with the ` zeroize ` crate feature.
268277- [ ` ZeroizeOnDrop ` ] : Only available with the ` zeroize ` crate feature. If the
269278 ` zeroize-on-drop ` feature is enabled, it implements [ ` ZeroizeOnDrop ` ] ,
@@ -352,12 +361,14 @@ conditions.
352361[ `core::intrinsics::discriminant_value` ] : https://doc.rust-lang.org/core/intrinsics/fn.discriminant_value.html
353362[ `derive_where` ] : https://docs.rs/derive-where/latest/derive_where/attr.derive_where.html
354363[ `Discriminant` ] : https://doc.rust-lang.org/core/mem/struct.Discriminant.html
364+ [ `Deserialize` ] : https://docs.rs/serde/latest/serde/derive.Deserialize.html
355365[ `Drop` ] : https://doc.rust-lang.org/core/ops/trait.Drop.html
356366[ `Eq` ] : https://doc.rust-lang.org/core/cmp/trait.Eq.html
357367[ `i32` ] : https://doc.rust-lang.org/core/primitive.i32.html
358368[ `isize` ] : https://doc.rust-lang.org/core/primitive.isize.html
359369[ `Ord` ] : https://doc.rust-lang.org/core/cmp/trait.Ord.html
360370[ `PartialEq` ] : https://doc.rust-lang.org/core/cmp/trait.PartialEq.html
361371[ `PartialOrd` ] : https://doc.rust-lang.org/core/cmp/trait.PartialOrd.html
372+ [ `Serialize` ] : https://docs.rs/serde/latest/serde/derive.Serialize.html
362373[ `transmute` ] : https://doc.rust-lang.org/core/mem/fn.transmute.html
363374[ `unreachable` ] : https://doc.rust-lang.org/core/macro.unreachable.html
0 commit comments