About rhai-ml
This crate provides some basic machine learning and artificial intelligence utilities for the Rhai
scripting language. For a complete API reference, check the docs.
Install
To use the latest released version of rhai-ml, add this to your Cargo.toml:
= "0.1.2"
To use the bleeding edge instead, add this:
= { = "https://github.com/cmccomb/rhai-ml" }
Usage
Using this crate is pretty simple! If you just want to evaluate a single line of Rhai, then you only need:
use FLOAT;
use eval;
let result = .unwrap;
If you need to use rhai-ml as part of a persistent Rhai scripting engine, then do this instead:
use ;
use MLPackage;
// Create a new Rhai engine
let mut engine = new;
// Add the rhai-ml package to the new engine
engine.register_global_module;
// Now run your code
let value = engine..unwrap;
Features
| Feature | Default | Description |
|---|---|---|
metadata |
Disabled | Enables exporting function metadata and is necessary for running doc-tests on Rhai examples. |