Function gtmpl::funcs::and[][src]

pub fn and(args: &[Value]) -> Result<Value, String>

Returns the boolean AND of its arguments by returning the first empty argument or the last argument, that is, "and x y" behaves as "if x then y else x". All the arguments are evaluated.

Example

use gtmpl::template;
let equal = template("{{ and 1 2.0 true . }}", "foo");
assert_eq!(&equal.unwrap(), "foo");