Crate mrusty [] [src]

mrusty. mruby safe bindings for Rust

mrusty lets you:

  • run Ruby 1.9 files with a very restricted API (without having to install Ruby)
  • reflect Rust structs and enums in mruby and run them

It does all this in a safely neat way, while also bringing spec testing and a REPL to the table.

Macros

describe

A macro useful to run mruby specs. You can pass a tuple of MrubyFiles dependencies as a second argument.

mrfn

A macro useful for defining Rust closures for mruby.

mruby_class

A macro that comes in handy when defining a pure mruby Class. It lets you define and control pure mruby types and returns the newly defined Class, unlike mrusty_class! which also handles Rust types.

mrusty_class

A macro that comes in handy when defining an mruby Class with Rust type reflection. It automates and simplifies the implementation of the MrubyFile trait. Thus, any type provided to mrusty_class! will get an MrubyFile implementation, unlike mruby_class! which implements a pure mruby class.

Structs

Class

A struct that wraps around an mruby Class.

Module

A struct that wraps around an mruby Module.

Mruby

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.

Repl

A struct that exposes an Mruby to a REPL.

Spec

A struct useful for mruby spec definition and running.

Value

A struct that wraps around any mruby variable.

Enums

MrubyError

An enum containing all possbile types of errors.

Traits

ClassLike

A trait which connects Class & Module.

MrubyFile

A trait useful for organising Rust types into dynamic mruby files.

MrubyImpl

A trait used on MrubyType which implements mruby functionality.

ReadLine

A trait which performs very basic readline utility.

Type Definitions

MrubyType

A type wrapper around a Rc<RefCell<Mruby>>. Created with Mruby::new().