summaryrefslogtreecommitdiff
path: root/dhall
diff options
context:
space:
mode:
Diffstat (limited to 'dhall')
-rw-r--r--dhall/Cargo.toml1
-rw-r--r--dhall/src/lib.rs1
-rw-r--r--dhall/src/serde.rs9
3 files changed, 11 insertions, 0 deletions
diff --git a/dhall/Cargo.toml b/dhall/Cargo.toml
index e898cde..7aa8b4f 100644
--- a/dhall/Cargo.toml
+++ b/dhall/Cargo.toml
@@ -16,6 +16,7 @@ bytecount = "0.5.1"
itertools = "0.8.0"
lalrpop-util = "0.16.3"
term-painter = "0.2.3"
+serde = { version = "1.0", features = ["derive"] }
serde_cbor = "0.9.0"
dhall_core = { path = "../dhall_core" }
dhall_generator = { path = "../dhall_generator" }
diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs
index b49d1c1..2d44115 100644
--- a/dhall/src/lib.rs
+++ b/dhall/src/lib.rs
@@ -26,6 +26,7 @@ pub use crate::traits::SimpleStaticType;
pub use crate::traits::StaticType;
pub use dhall_generator::SimpleStaticType;
pub mod expr;
+pub mod serde;
pub fn from_str<'a, T: Deserialize<'a>>(
s: &'a str,
diff --git a/dhall/src/serde.rs b/dhall/src/serde.rs
new file mode 100644
index 0000000..278ea7a
--- /dev/null
+++ b/dhall/src/serde.rs
@@ -0,0 +1,9 @@
+use crate::expr::Type;
+use crate::traits::Deserialize;
+use crate::traits::Result;
+
+impl<'a, T: serde::Deserialize<'a>> Deserialize<'a> for T {
+ fn from_str(_s: &'a str, _ty: Option<&Type>) -> Result<Self> {
+ unimplemented!()
+ }
+}