#file-format #read-write #serde #file-read #file #read #write

serde_rw

Extend serde serializers and deserializers with the ability to read / write different file formats from / to files

9 unstable releases (3 breaking)

0.4.2 Aug 31, 2023
0.4.1 Aug 31, 2023
0.4.0 Jul 19, 2023
0.3.0 Jul 14, 2023
0.1.5 Jun 22, 2023

#2410 in Parser implementations

Download history 4/week @ 2024-02-25 292/week @ 2024-03-10 12/week @ 2024-03-17 167/week @ 2024-03-31

471 downloads per month

MIT license

26KB
233 lines

serde_rw

A library to extend serde serializers and deserializers with the ability to read / write different file formats from / to files.

Usage

  • To read from files, this crate provides the trait FromFile.
  • To write to files, this crate provides the trait ToFile.

Default implementations

  • FromFile is auto-implemented for serde::Deserialize.
  • ToFile is auto-implemented for serde::Serialize.

File formats

Currently, the following file formats are supported:

  • JSON via the json feature.
  • TOML via the toml feature.
  • XML via the xml feature.
  • YAML via the yaml feature.

Credits

This library is inspired by from_file by Shane Osbourne.

Dependencies

~0.5–1.9MB
~40K SLoC