serde_with v1.8.0
Added
-
Added
PickFirst
adapter forserde_as
. #291
It allows to deserialize from multiple different forms.
Deserializing a number from either a number or string can be implemented like:#[serde_as(as = "PickFirst<(_, DisplayFromStr)>")] value: u32,
-
Implement
SerializeAs
/DeserializeAs
for more wrapper types. #288, #293
This now supports:Arc
,sync::Weak
Rc
,rc::Weak
Cell
,RefCell
Mutex
,RwLock
Result
Changed
- Add a new
serde_with::rust::map_as_tuple_list
module as a replacement forserde_with::rust::btreemap_as_tuple_list
andserde_with::rust::hashmap_as_tuple_list
.
The new module usesIntoIterator
andFromIterator
as trait bound making it usable in more sitations.
The old names continue to exist but are marked as deprecated.
Deprecated
- Deprecated the module names
serde_with::rust::btreemap_as_tuple_list
andserde_with::rust::hashmap_as_tuple_list
.
You can useserde_with::rust::map_as_tuple_list
as a replacement.