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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//! Neodyn Exchange defines the interchange (serialization) format for Neodyn DB.
//!
//! ## Caveats
//!
//! Neodyn Exchange has three, *more or less equivalent* representations:
//!
//! * An in-memory tree represented by the [`Value`](value/enum.Value.html)
//! type and the corresponding [serializer](ser/value/index.html) and
//! [deserializer](de/value/index.html);
//! * A human-readable text format defined by the appropriate
//! [serializer](ser/text/index.html) and [deserializer](de/text/index.html);
//! * And a compact, efficient, machine-readable binary format,
//! defined by its own [serializer](ser/binary/index.html) and
//! [deserializer](de/binary/index.html).
//!
//! A best effort is made to bring (and keep) the semantics of these three
//! formats as close as possible. In particular, the formats are supposed to
//! be able to represent the same set of values. However, as usual, care must
//! be taken when serializing a value into one of the human-readable formats
//! and deserializing it from the compact binary format, or vice versa.
//!
//! Neodyn Exchange is a 64-bit format. 128-bit integers are supported as long
//! as their value dynamically fits into the 64-bit type of the same signedness.
//!
//! Floating-point values that represent a `NaN` will be serialized as `null`,
//! but `null` will not deserialize as `NaN`. This is in line with the behavior
//! of `serde_json`. Serializing `NaN` is discouraged anyway -- it is a weird
//! artefact of the past, and we should not be using it, since Rust has proper
//! optionals in the type system.
//!
//! ## Crate Features
//!
//! * `quickcheck`: provides `impl Arbitrary for Value`. Required for
//! running tests: use `cargo test --release --features quickcheck`.
//! * `serde_json`: provides conversions (`From` and `TryFrom`) between
//! `neodyn_xc::Value` and `serde_json::Value`.
//! * `chrono`: provides `impl From<DateTime> for Value`.
//! * `uuid`: provides `impl From<Uuid> for Value`.
//! * `full`: enable all of the above features.
pub use crate::;