1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! # serde-structprop
//!
//! A [serde](https://serde.rs/) serializer and deserializer for the
//! [structprop](https://github.com/edgeware/structprop) configuration file
//! format — a simple, human-readable format for structured data.
//!
//! ## Format overview
//!
//! ```text
//! # comment
//! key = value
//! key = "value with spaces"
//! key = 42
//! key = true
//!
//! # nested object
//! section {
//! nested_key = value
//! }
//!
//! # array of scalars
//! list = { a b c }
//! ```
//!
//! ## Quick start
//!
//! ```rust
//! use serde::{Deserialize, Serialize};
//! use serde_structprop::{from_str, to_string};
//!
//! #[derive(Debug, Serialize, Deserialize, PartialEq)]
//! struct Config {
//! hostname: String,
//! port: u16,
//! }
//!
//! // Deserialize
//! let input = "hostname = localhost\nport = 8080\n";
//! let cfg: Config = from_str(input).unwrap();
//! assert_eq!(cfg.hostname, "localhost");
//! assert_eq!(cfg.port, 8080);
//!
//! // Serialize
//! let out = to_string(&cfg).unwrap();
//! assert!(out.contains("hostname = localhost"));
//! assert!(out.contains("port = 8080"));
//! ```
//!
//! ## Module layout
//!
//! | Module | Contents |
//! |---|---|
//! | [`lexer`] | Tokenizer: converts raw text to `Token`s |
//! | [`mod@parse`] | Recursive-descent parser: produces a [`parse::Value`] tree |
//! | [`de`] | `serde::Deserializer` implementation |
//! | [`ser`] | `serde::Serializer` implementation |
//! | [`error`] | [`Error`] type shared by all modules |
/// Serde deserializer for structprop documents.
/// Error type shared by the serializer and deserializer.
/// Lexer (tokenizer) that converts raw structprop text into tokens.
/// Parser that converts a token stream into a [`parse::Value`] tree.
/// Serde serializer for structprop documents.
pub use from_str;
pub use ;
pub use ;
pub use to_string;