Function casbin::rhai::eval

source ·
pub fn eval<T>(script: &str) -> Result<T, Box<EvalAltResult>>
where T: Variant + Clone,
Expand description

Evaluate a string as a script, returning the result value or an error.

§Example

let result: i64 = rhai::eval("40 + 2")?;

assert_eq!(result, 42);