Struct mrusty::Mruby [] [src]

pub struct Mruby {
    pub mrb: *const MrState,
    // some fields omitted
}

A safe struct for the mruby API. The struct only contains creation and desctruction methods. Creating an Mruby returns a MrubyType (Rc<RefCell<Mruby>>) which implements MrubyImpl where the rest of the implemented API is found.

Examples

use mrusty::{Mruby, MrubyImpl};

let mruby = Mruby::new();
let result = mruby.run("2 + 2 == 5").unwrap();

assert_eq!(result.to_bool().unwrap(), false);

Fields

mrb: *const MrState

Methods

impl Mruby
[src]

fn new() -> MrubyType

Creates an mruby state and context stored in a MrubyType (Rc<RefCell<Mruby>>).

Example

let mruby = Mruby::new();

Trait Implementations

impl Drop for Mruby
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more