Function rhai_sci::eval

source ·
pub fn eval<T: Clone + Send + Sync + 'static>(
    script: &str
) -> Result<T, Box<EvalAltResult>>
Expand description

This provides the ability to easily evaluate a line (or lines) of code without explicitly setting up a script engine

use rhai_sci::eval;
use rhai::FLOAT;
print!("{:?}", eval::<FLOAT>("let x = max(5, 2); x + min(3, 72)"));