Crate jsonnet

Source
Expand description

§jsonnet bindings for Rust

This library contains bindings to the jsonnet C library, a template language that generates JSON and YAML.

Almost all interaction with this module will be via the JsonnetVm type.

§Examples

use jsonnet::JsonnetVm;

let mut vm = JsonnetVm::new();
let output = vm.evaluate_snippet("example", "'Hello ' + 'World'").unwrap();
assert_eq!(output.to_string(), "\"Hello World\"\n");

Structs§

Error
Error returned from jsonnet routines on failure.
EvalList
Result from “stream” eval methods.
EvalListIter
Iterator returned from “stream” eval methods.
EvalMap
Result from “multi” eval methods.
EvalMapIter
Iterator returned from “multi” eval methods.
JsonVal
Rust wrapper for borrowed libjsonnet JSON values.
JsonValue
Rust wrapper for owned libjsonnet JSON values.
JsonnetString
Rust wrapper for libjsonnet string values.
JsonnetVm
Jsonnet virtual machine context.

Enums§

FmtComment
Comment style
FmtString
String literal style

Functions§

jsonnet_version
Return the version string of the Jsonnet interpreter. Conforms to semantic versioning.