summaryrefslogtreecommitdiff
path: root/serde_dhall
diff options
context:
space:
mode:
authorNadrieril2020-03-22 21:29:36 +0000
committerNadrieril2020-03-31 21:45:31 +0100
commitfd4a81b1a92c1859941538b7f2212c621f4b43fd (patch)
tree2fb6ec8dc70d1edfc7e4a3f5151bea15caac34ea /serde_dhall
parent002d7c2a74647312a821598ac3d9f5521296873d (diff)
Hide SimpleValue from api
Diffstat (limited to 'serde_dhall')
-rw-r--r--serde_dhall/src/lib.rs4
-rw-r--r--serde_dhall/src/simple.rs8
-rw-r--r--serde_dhall/src/value.rs3
3 files changed, 6 insertions, 9 deletions
diff --git a/serde_dhall/src/lib.rs b/serde_dhall/src/lib.rs
index e59255c..19d3f7e 100644
--- a/serde_dhall/src/lib.rs
+++ b/serde_dhall/src/lib.rs
@@ -174,7 +174,7 @@ doc_comment::doctest!("../../README.md");
/// Finer-grained control over deserializing Dhall values
pub mod options;
-/// Serde-compatible Dhall values and their type
+/// Serde-compatible Dhall types
pub mod simple;
/// Arbitrary Dhall values
pub mod value;
@@ -192,6 +192,6 @@ pub use deserialize::Deserialize;
pub(crate) use deserialize::Sealed;
pub use error::{Error, Result};
pub use shortcuts::{from_str, from_str_manual_type, from_str_static_type};
-pub use simple::{Type as SimpleType, Value as SimpleValue};
+pub use simple::{Type as SimpleType};
pub use static_type::StaticType;
pub use value::Value;
diff --git a/serde_dhall/src/simple.rs b/serde_dhall/src/simple.rs
index 3d77853..6f3dc93 100644
--- a/serde_dhall/src/simple.rs
+++ b/serde_dhall/src/simple.rs
@@ -6,14 +6,13 @@ use dhall::syntax::{Builtin, ExprKind, NumKind, Span};
use crate::{Deserialize, Error, Result, Sealed};
/// A simple value of the kind that can be encoded/decoded with serde
-/// TODO
#[derive(Debug, Clone, PartialEq, Eq)]
-pub struct Value {
+pub(crate) struct Value {
kind: Box<ValKind>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
-pub enum ValKind {
+pub(crate) enum ValKind {
// TODO: redefine NumKind locally
Num(NumKind),
Text(String),
@@ -24,8 +23,7 @@ pub enum ValKind {
Union(String, Option<Value>),
}
-/// The type of a `simple::Value`.
-/// TODO
+/// The type of a value that can be decoded by Serde. For example, `{ x: Bool, y: List Natural }`.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Type {
kind: Box<TyKind>,
diff --git a/serde_dhall/src/value.rs b/serde_dhall/src/value.rs
index 2557efe..41a96ea 100644
--- a/serde_dhall/src/value.rs
+++ b/serde_dhall/src/value.rs
@@ -26,8 +26,7 @@ impl Value {
}
/// Converts a Value into a SimpleValue.
- /// TODO
- pub fn to_simple_value(&self) -> Option<SimpleValue> {
+ pub(crate) fn to_simple_value(&self) -> Option<SimpleValue> {
self.as_simple_val.clone()
}
/// Converts a Value into a SimpleType.