Trait serde_dhall::FromDhall
source · pub trait FromDhall: Sealed + Sized { }
Expand description
A data structure that can be deserialized from a Dhall expression.
This is automatically implemented for any type that serde can deserialize. In fact, this trait cannot be implemented manually. To implement it for your type, use serde’s derive mechanism.
Example
use serde::Deserialize;
// Use serde's derive
#[derive(Deserialize)]
struct Point {
x: u64,
y: u64,
}
// Convert a Dhall string to a Point.
let point: Point = serde_dhall::from_str("{ x = 1, y = 1 + 1 }").parse()?;