#builder-pattern #serde #deserialize #derive-builder #field-name #serde-derive #aims

serde_builder

serde extension to build de/serialization algorithms for types using a builder pattern

3 unstable releases

0.2.0 Jul 14, 2023
0.1.1 Jul 13, 2023
0.1.0 Jul 12, 2023

#1129 in Encoding

Download history 14/week @ 2024-02-23 8/week @ 2024-03-01 102/week @ 2024-03-08 12/week @ 2024-03-15 24/week @ 2024-03-29

138 downloads per month

MIT and LGPL-2.0

28KB
572 lines

serde_builder

An add-on to serde that aims to provide an alternative to derive using a builder pattern instead

At the time this is a proof of concept. To see how the usage looks, run simple_de and simple_ser examples and look at their code. Additionally, you can check the documentation on docs.rs to see the api fully

Theoretically, deserialization may fail due to wrong field names being provided to deserializer. If this happens, enable leaking feature, which supplies correct field names at expense of leaking memory through Box::leak

TODO list:

  • Enum de/serialization
  • Transformations along with checks
  • Defaults dependent on other values
  • Become on-par in customizability with serde derive

Dependencies

~0.4–1MB
~23K SLoC