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
|
/*!
RON is a simple config format which looks similar to Rust syntax.
## Features
* Data types
* Structs, typename optional
* Tuples
* Enums
* Lists
* Maps
* Units (`()`)
* Optionals
* Primitives: booleans, numbers, string, char
* Allows nested layout (similar to JSON)
* Supports comments
* Trailing commas
* Pretty serialization
## Syntax example
```rust,ignore
Game(
title: "Hello, RON!",
level: Level( // We could just leave the `Level` out
buildings: [
(
size: (10, 20),
color: Yellow, // This as an enum variant
owner: None,
),
(
size: (20, 25),
color: Custom(0.1, 0.8, 1.0),
owner: Some("guy"),
),
],
characters: {
"guy": (
friendly: true,
),
},
),
)
```
## Usage
Just add it to your `Cargo.toml`:
```toml
[dependencies]
ron = "*"
```
Serializing / Deserializing is as simple as calling `to_string` / `from_str`.
!*/
#![doc(html_root_url = "https://docs.rs/ron/0.6.0")]
pub mod de;
pub mod ser;
pub mod error;
pub mod value;
pub mod extensions;
pub use de::{from_str, Deserializer};
pub use error::{Error, Result};
pub use ser::{to_string, Serializer};
pub use value::{Map, Number, Value};
mod parse;
|