summaryrefslogtreecommitdiff
path: root/dhall/src/lib.rs
diff options
context:
space:
mode:
authorNadrieril2019-05-06 23:21:19 +0200
committerNadrieril2019-05-06 23:21:19 +0200
commit5b91eaa9d6b70a2ac72fe19f2d21871c8d94b017 (patch)
tree9ab6c6025d8f994c1ca10db1c4b8ea7d39087290 /dhall/src/lib.rs
parent60129b7d1c0ea8bdf2ec666fa51957e97465e88f (diff)
Move api-related modules into an api module
Diffstat (limited to '')
-rw-r--r--dhall/src/lib.rs41
1 files changed, 3 insertions, 38 deletions
diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs
index 9f9c315..989170a 100644
--- a/dhall/src/lib.rs
+++ b/dhall/src/lib.rs
@@ -123,43 +123,8 @@
#[macro_use]
mod tests;
+mod api;
pub mod error;
mod phase;
-mod serde;
-mod traits;
-
-/// Deserialization of Dhall expressions into Rust
-pub mod de {
- pub use crate::traits::{Deserialize, SimpleStaticType, StaticType};
- #[doc(hidden)]
- pub use dhall_proc_macros::SimpleStaticType;
-
- /// Deserialize an instance of type T from a string of Dhall text.
- ///
- /// This will recursively resolve all imports in the expression, and
- /// typecheck it before deserialization. Relative imports will be resolved relative to the
- /// provided file. More control over this process is not yet available
- /// but will be in a coming version of this crate.
- ///
- /// If a type is provided, this additionally checks that the provided
- /// expression has that type.
- pub fn from_str<'a, T: Deserialize<'a>>(
- s: &'a str,
- ty: Option<&crate::phase::Type>,
- ) -> crate::error::Result<T> {
- T::from_str(s, ty)
- }
-
- /// Deserialize an instance of type T from a string of Dhall text,
- /// additionally checking that it matches the type of T.
- ///
- /// This will recursively resolve all imports in the expression, and
- /// typecheck it before deserialization. Relative imports will be resolved relative to the
- /// provided file. More control over this process is not yet available
- /// but will be in a coming version of this crate.
- pub fn from_str_auto_type<'a, T: Deserialize<'a> + StaticType>(
- s: &'a str,
- ) -> crate::error::Result<T> {
- from_str(s, Some(&<T as StaticType>::get_static_type()))
- }
-}
+pub use api::de;
+pub(crate) use api::traits;