Expand description
§serde_rison
A serde implementation for the RISON data format.
RISON is a compact, URI-friendly alternative to JSON. It uses () instead
of {}, !() instead of [], !t/!f/!n for booleans and null, and
supports unquoted strings where possible.
§Example
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, PartialEq)]
struct Person {
name: String,
age: u32,
}
let person = Person {
name: "John".into(),
age: 30,
};
// Serialize to RISON
let rison = serde_rison::to_string(&person).unwrap();
assert_eq!(rison, "(name:John,age:30)");
// Deserialize from RISON
let back: Person = serde_rison::from_str(&rison).unwrap();
assert_eq!(person, back);Structs§
- Deserializer
- Number
- Represents a RISON number, whether integer or floating point.
- Serializer