mruby-eval

Crates.iomruby-eval
lib.rsmruby-eval
version0.1.0
sourcesrc
created_at2021-10-06 08:50:36.414148
updated_at2021-10-06 08:50:36.414148
descriptionA package to execute ruby code trough mruby bindings
homepage
repositoryhttps://github.com/DumbMahreeo/mruby-eval
max_upload_size
id461044
size5,146
Max (callb4ck)

documentation

README

mruby-eval

This is a package I made for another lib, but here's how to use it:

use mruby-eval::{eval_to, evaluators::eval_to_string};

eval_to_string("1+2") // returns an Option<String>, in this case Some(String::from("3"))

eval_to!(i32, "1+2") // eval_to!<type, expr> returns an Err<type, Parse#Error>
                     // (# in ParseError is the type, ex: ParseIntError)
                     //
                     // So in this case it's Ok(3)

Commit count: 2

cargo fmt