1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! `gtmpl_value_ng` holds the value type used by [`gtmpl-ng`][gtmpl-ng], the Golang
//! templating language for Rust. A [`Value`] is what a template parses its literals
//! into and what a context hands it back.
//!
//! The [`From`] trait is implemented for:
//!
//! * `String`, `&str`, `Cow<str>`
//! * most numeric types `u64, u32, …, i64, i32, …, f64, f32`
//! * `bool`
//! * `Vec<Value>`, `&[Value]`
//! * `HashMap<String, Value>`
//! * `Option<T>`, where `None` becomes [`Value::NoValue`]
//!
//! [`gtmpl_derive_ng`][gtmpl_derive_ng] derives it for a struct.
//!
//! # Examples
//!
//! ```rust
//! use gtmpl_value_ng::Value;
//!
//! let v: Value = "something".into();
//! assert_eq!(v.to_string(), "something");
//! ```
//!
//! # Relation to `gtmpl_value`
//!
//! This crate is a fork of [`gtmpl_value`][gtmpl_value] by Florian Dieminger, taken
//! from its `master` branch at `a333139` — which is two years ahead of the last
//! release on crates.io and carries the fix for negative non-integer numbers that
//! `0.5.1` truncates. It lives in the same workspace as the engine so that the value
//! type and the engine are released together.
//!
//! With the `gtmpl_value_compat` feature, [`Value`] gains a [`TryFrom`] conversion from
//! `gtmpl_value::Value`, so a tree that still derives against the published crate can
//! be migrated one call site at a time.
//!
//! [gtmpl-ng]: https://github.com/firstdorsal/gtmpl-rust
//! [gtmpl_derive_ng]: https://docs.rs/gtmpl_derive_ng
//! [gtmpl_value]: https://github.com/fiji-flo/gtmpl_value
pub use crateFromLegacyValueError;
pub use crate*;
pub use crate;
pub use crate*;
/// Compiles the README's examples as doc tests, so a documented example cannot stop
/// building without the suite noticing. Nothing is rendered into the real docs.
/// Gated on `gtmpl_value_compat` because some of the examples use it; CI runs with every
/// feature on, so they are all checked there.
;