2 releases

0.1.3 Aug 22, 2020
0.1.0 Aug 10, 2020

#288 in #serialization

Download history 65/week @ 2021-08-10 8/week @ 2021-08-17 58/week @ 2021-08-24 4/week @ 2021-08-31 43/week @ 2021-09-07 37/week @ 2021-09-14 30/week @ 2021-09-21 9/week @ 2021-09-28 30/week @ 2021-10-05 36/week @ 2021-10-12 27/week @ 2021-10-19 31/week @ 2021-10-26 31/week @ 2021-11-02 4/week @ 2021-11-09 21/week @ 2021-11-16 24/week @ 2021-11-23

81 downloads per month

MIT/Apache

125KB
3.5K SLoC

This is a temporary fork of the ron crate for bevy engine.


lib.rs:

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

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:

[dependencies]
ron = "*"

Serializing / Deserializing is as simple as calling to_string / from_str.

!

Dependencies

~0.8–1.5MB
~34K SLoC