Expand description

Neodyn Exchange defines the interchange (serialization) format for Neodyn DB.

Caveats

Neodyn Exchange has three, more or less equivalent representations:

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.

Re-exports

pub use crate::value::Value;
pub use crate::ser::value::to_value;
pub use crate::ser::text::to_string;
pub use crate::ser::binary::to_bytes;
pub use crate::ser::binary::to_writer;
pub use crate::ser::binary::to_writer_buffered;
pub use crate::de::value::from_value;
pub use crate::de::value_ref::from_value_ref;
pub use crate::de::text::from_str;
pub use crate::de::binary::from_bytes;
pub use crate::de::binary::from_reader;
pub use crate::de::binary::from_reader_buffered;

Modules

Umbrella module for deserializing the exchange format from human-readable text, a compact binary format, or an in-memory value tree.

Common Error and Result types.

This module codifies the bit-level details of the binary format.

Umbrella module for serializing the exchange format as human-readable text, a compact binary format, or an in-memory value tree.

Manipulating source locations.

In-memory, structured representation of a Neodyn Exchange value tree.