#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

#2985 in Parser implementations

Download history 1/week @ 2024-09-19 1/week @ 2024-09-26 1/week @ 2024-10-03

125 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.4–1.8MB
~38K SLoC