From bc12f1179143f20a54664ba8ce51d24834d2f1ff Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 16 Jan 2020 17:20:10 +0000 Subject: Deserialize more types --- serde_dhall/src/lib.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'serde_dhall/src/lib.rs') diff --git a/serde_dhall/src/lib.rs b/serde_dhall/src/lib.rs index 45aca57..0878471 100644 --- a/serde_dhall/src/lib.rs +++ b/serde_dhall/src/lib.rs @@ -64,6 +64,28 @@ //! # } //! ``` //! +//! # Type correspondence +//! +//! The following Dhall types correspond to the following Rust types: +//! +//! Dhall | Rust +//! -------|------ +//! `Bool` | `bool` +//! `Natural` | `u64`, `u32`, ... +//! `Integer` | `i64`, `i32`, ... +//! `Double` | `f64`, `f32`, ... +//! `Text` | `String` +//! `List T` | `Vec` +//! `Optional T` | `Option` +//! `{ x: T, y: U }` | structs +//! `{ _1: T, _2: U }` | `(T, U)`, structs +//! `{ x: T, y: T }` | `HashMap`, structs +//! `< x: T \| y: U >` | enums +//! `T -> U` | unsupported +//! `Prelude.JSON.Type` | unsupported +//! `Prelude.Map.Type T U` | unsupported +//! +//! //! # Replacing `serde_json` or `serde_yaml` //! //! If you used to consume JSON or YAML, you only need to replace [serde_json::from_str] or -- cgit v1.2.3