wtfm_serde/
lib.rs

1#![doc(html_playground_url = "https://play.rust-lang.org/")]
2//! # WTFM for [serde]
3//! 
4//! Although this is an empty crate with doc-tests only, `cargo doc`
5//! by default builds documentation for dependencies
6//!
7//! ```sh
8//! % du -hsc docs/doc/*
9//! 4.0K	docs/doc/crates.js
10//! 4.0K	docs/doc/help.html
11//! 64K	docs/doc/itoa
12//! 2.9M	docs/doc/memchr
13//! 700K	docs/doc/proc_macro2
14//! 172K	docs/doc/quote
15//! 1.4M	docs/doc/search.index
16//! 5.0M	docs/doc/serde
17//! 4.4M	docs/doc/serde_core
18//! 20K	docs/doc/serde_derive
19//! 4.1M	docs/doc/serde_json
20//! 4.0K	docs/doc/settings.html
21//! 9.1M	docs/doc/src
22//! 4.0K	docs/doc/src-files.js
23//! 1.8M	docs/doc/static.files
24//! 11M	docs/doc/syn
25//! 1.3M	docs/doc/trait.impl
26//! 420K	docs/doc/type.impl
27//! 44K	docs/doc/unicode_ident
28//! 16K	docs/doc/wtfm_serde
29//! 52K	docs/doc/zmij
30//! 42M	total
31//! ```
32//! We can navigate to them via the sidebar menu.
33//!
34//! ## It works!
35//! <https://serde.rs/#data-structures>
36//! ```
37//! #[derive(serde::Serialize, serde::Deserialize, Debug)]
38//! struct Point {
39//!    x: i32,
40//!    y: i32,
41//! }
42//!
43//! let point = Point { x: 1, y: 2 };
44//!
45//! let serialized = serde_json::to_string(&point).unwrap();
46//! debug_assert_eq!(format!("{}", serialized), "{\"x\":1,\"y\":2}");
47//!
48//! let deserialized: Point = serde_json::from_str(&serialized).unwrap();
49//! debug_assert_eq!(format!("{:?}", deserialized), "Point { x: 1, y: 2 }");
50//! ``` 
51//! ```sh
52//!    Doc-tests wtfm_serde
53//!
54//! running 1 test
55//! test src/lib.rs - (line 36) ... ok
56//!
57//! test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
58//!
59//! all doctests ran in 0.48s; merged doctests compilation took 0.25s
60//! ```