fson 1.0.0

Flexible Serialized Object Notation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::stringify_json::stringify;
use crate::Value;

/// Generate FSON from Value
pub fn from(val: Value) -> String {
    stringify(val, 0, false)
}

#[macro_export]
macro_rules! object {
    ($( $key: expr => $val: expr ),*) => {{
         let mut map: std::collections::HashMap<String, Value> = std::collections::HashMap::new();
         $( map.insert($key, $val); )*
         map
    }}
}