diff options
Diffstat (limited to 'dhall/src/lib.rs')
-rw-r--r-- | dhall/src/lib.rs | 51 |
1 files changed, 5 insertions, 46 deletions
diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs index a531f64..8d1496a 100644 --- a/dhall/src/lib.rs +++ b/dhall/src/lib.rs @@ -123,51 +123,10 @@ #[macro_use] mod tests; -#[cfg(test)] -mod parser; - -mod binary; -/// When manipulating Dhall expressions goes wrong. +pub(crate) mod api; +pub(crate) mod core; pub mod error; -pub mod expr; -mod imports; -mod normalize; -mod serde; -mod traits; -mod typecheck; - -/// 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::expr::Type>, - ) -> crate::error::Result<T> { - T::from_str(s, ty) - } +pub(crate) mod phase; +pub(crate) use api::traits; - /// 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; |