summaryrefslogtreecommitdiff
path: root/serde_dhall/src/value.rs
diff options
context:
space:
mode:
authorNadrieril2020-10-28 22:43:34 +0000
committerNadrieril2020-10-28 22:52:41 +0000
commit48bb9c03b0ace9efa33315e06c47a868e5c4ed36 (patch)
tree2e8e3464fee44e88e92c0bb9330d7cf7c56cccf1 /serde_dhall/src/value.rs
parent27377f045a2449c86ea3b680d168d2224c90e5e3 (diff)
Move table of type correspondances
Diffstat (limited to 'serde_dhall/src/value.rs')
-rw-r--r--serde_dhall/src/value.rs23
1 files changed, 22 insertions, 1 deletions
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<T>`
+/// `Optional T` | `Option<T>`
+/// `{ x: T, y: U }` | structs
+/// `{ _1: T, _2: U }` | `(T, U)`, structs
+/// `{ x: T, y: T }` | `HashMap<String, T>`, structs
+/// `< x: T \| y: U >` | enums
+/// `Prelude.Map.Type Text T` | `HashMap<String, T>`, 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`