Module serde_hjson::value
source · [−]Expand description
Hjson Value
This module is centered around the Value
type, which can represent all possible Hjson values.
Example of use:
extern crate serde_hjson;
use serde_hjson::Value;
fn main() {
let s = "{x: 1.0, y: 2.0}";
let value: Value = serde_hjson::from_str(s).unwrap();
}
It is also possible to deserialize from a Value
type:
extern crate serde_hjson;
use serde_hjson::{Value, Map};
fn main() {
let mut map = Map::new();
map.insert(String::from("x"), Value::F64(1.0));
map.insert(String::from("y"), Value::F64(2.0));
let value = Value::Object(map);
let map: Map<String, f64> = serde_hjson::from_value(value).unwrap();
}
Structs
Creates a serde::Deserializer
from a Value
object.
Create a serde::Serializer
that serializes a Serialize
e into a Value
.
Enums
Represents a Hjson/JSON value
Traits
A trait for converting values to Hjson
Functions
Shortcut function to decode a Hjson Value
into a T
Shortcut function to encode a T
into a Hjson Value
Type Definitions
Represents a key/value type.
Represents the IntoIter
type.