From 48bb9c03b0ace9efa33315e06c47a868e5c4ed36 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 28 Oct 2020 22:43:34 +0000 Subject: Move table of type correspondances --- serde_dhall/src/value.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'serde_dhall/src/value.rs') diff --git a/serde_dhall/src/value.rs b/serde_dhall/src/value.rs index 50c12bd..b8ad199 100644 --- a/serde_dhall/src/value.rs +++ b/serde_dhall/src/value.rs @@ -124,6 +124,28 @@ pub enum SimpleValue { /// [`StaticType`]: trait.StaticType.html /// [`Deserializer::static_type_annotation`]: options/struct.Deserializer.html#method.static_type_annotation /// +/// # 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 +/// `Prelude.Map.Type Text T` | `HashMap`, structs +/// `T -> U` | unsupported +/// `Prelude.JSON.Type` | unsupported +/// `Prelude.Map.Type T U` | unsupported +/// /// # Examples /// /// ```rust @@ -159,7 +181,6 @@ pub enum SimpleValue { /// # Ok(()) /// # } /// ``` -/// #[derive(Debug, Clone, PartialEq, Eq)] pub enum SimpleType { /// Corresponds to the Dhall type `Bool` -- cgit v1.2.3