casbin::rhai

Function eval_file

pub fn eval_file<T>(path: impl AsRef<Path>) -> Result<T, Box<EvalAltResult>>
where T: Variant + Clone,
Expand description

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

Not available under no_std or WASM.

ยงExample

let result = rhai::eval_file::<i64>("script.rhai")?;