Function serde_dhall::from_file

source ·
pub fn from_file<'a, P: AsRef<Path>>(path: P) -> Deserializer<'a, NoAnnot>
Expand description

Deserialize a value from a Dhall file.

This returns a Deserializer object. Call the parse() method to get the deserialized value, or use other Deserializer methods to control the deserialization process.

Imports will be resolved relative to the provided file’s path.

Example

use serde::Deserialize;

// We use serde's derive feature
#[derive(Deserialize)]
struct Point {
    x: u64,
    y: u64,
}

// Parse the Dhall file as a Point.
let point: Point = serde_dhall::from_file("foo.dhall").parse()?;