Function serde_dhall::from_binary_file
source · [−]pub fn from_binary_file<'a, P: AsRef<Path>>(
path: P
) -> Deserializer<'a, NoAnnot>
Expand description
Deserialize a value from a CBOR-encoded Dhall binary file. The binary format is specified by the Dhall standard specification and is mostly used for caching expressions. Using the format is not recommended because errors won’t have a file to refer to and thus will be hard to fix.
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_binary_file("foo.dhallb").parse()?;