Crate gtmpl_value

Source
Expand description

gtmpl_value is a basic implementation for internal values within gtmpl-rust. It is used as to represent values parsed from the template and from the context.

The From trait is implemented for:

  • String, &str
  • most numeric types u64, u32, …, i64, i32, …, f64, f32
  • bool
  • Vec<Value>, &[Value]
  • HashMap<String, Value>

gtmpl_derive provides a custom derive for structs.

§Examples

extern crate gtmpl_value;
use gtmpl_value::Value;

fn main() {
    let v: Value = "something".into();
    println!("{}", v);
}

Structs§

Function
Wrapper struct for Func.
Number
Internal number format for gtmpl_value.

Enums§

FuncError
Value
Represents a gtmpl value.

Traits§

FromValue
Convert Value into something.

Functions§

from_value
FromValue wrapped in a macro (required for gtmpl_fn! macro).

Type Aliases§

Func
Function type supported by gtmpl_value.