var searchIndex = {}; searchIndex["mrusty"] = {"doc":"# mrusty. mruby safe bindings for Rust","items":[[3,"Class","mrusty","A `struct` that wraps around an mruby `Class`.",null,null],[3,"Mruby","","A safe `struct` for the mruby API. The `struct` only contains creation and desctruction\nmethods. Creating an `Mruby` returns a `MrubyType` (`Rc<RefCell<Mruby>>`) which implements\n`MrubyImpl` where the rest of the implemented API is found.",null,null],[12,"mrb","","",0,null],[3,"Value","","A `struct` that wraps around any mruby variable.",null,null],[3,"Repl","","A `struct` that exposes an `Mruby` to a REPL.",null,null],[3,"Spec","","A `struct` useful for mruby spec definition and running.",null,null],[4,"MrubyError","","An `enum` containing all possbile types of errors.",null,null],[13,"Cast","","type cast error",1,null],[13,"Undef","","undefined type error",1,null],[13,"Runtime","","mruby runtime error",1,null],[13,"Filetype","","unrecognized file type error",1,null],[13,"Io","","Rust `Io` error",1,null],[11,"new","","Creates an mruby state and context stored in a `MrubyType` (`Rc<RefCell<Mruby>>`).",0,{"inputs":[],"output":{"name":"mrubytype"}}],[11,"fmt","","",1,null],[11,"fmt","","",1,null],[11,"description","","",1,null],[11,"from","","",1,{"inputs":[{"name":"error"}],"output":{"name":"mrubyerror"}}],[11,"drop","","",0,null],[11,"init","","Initializes the `self` mruby object passed to `initialize` with a Rust object of type `T`.",2,null],[11,"call","","Calls method `name` on a `Value` passing `args`.",2,null],[11,"call_unchecked","","Calls method `name` on a `Value` passing `args`. If call fails, mruby will be left to\nhandle the exception.",2,null],[11,"has_var","","Returns whether the instance variable `name` is defined on a `Value`.",2,null],[11,"get_var","","Returns the value of the instance variable `name` in a `Some` or `None` if it is not\ndefined.",2,null],[11,"set_var","","Sets the value of the instance variable `name` to `value`.",2,null],[11,"class","","Returns the `Class` of an mruby `Value`.",2,null],[11,"to_bool","","Casts a `Value` and returns a `bool` in an `Ok` or an `Err` if the types mismatch.",2,null],[11,"to_i32","","Casts a `Value` and returns an `i32` in an `Ok` or an `Err` if the types mismatch.",2,null],[11,"to_f64","","Casts a `Value` and returns an `f64` in an `Ok` or an `Err` if the types mismatch.",2,null],[11,"to_str","","Casts a `Value` and returns a `&str` in an `Ok` or an `Err` if the types mismatch.",2,null],[11,"to_obj","","Casts mruby `Value` of `Class` `name` to Rust type `Rc<T>`.",2,null],[11,"to_option","","Casts mruby `Value` of `Class` `name` to Rust `Option` of `Rc<T>`.",2,null],[11,"to_vec","","Casts mruby `Value` of `Class` `Array` to Rust type `Vec<Value>`.",2,null],[11,"to_class","","Casts mruby `Value` of `Class` `Class` to Rust type `Class`.",2,null],[11,"to_module","","Casts mruby `Value` of `Class` `Module` to Rust type `Module`.",2,null],[11,"clone","","",2,null],[11,"eq","","",2,null],[11,"fmt","","",2,null],[11,"include","","Includes a `Module` in a `Class`.",3,null],[11,"def_const","","Defines constant with name `name` and value `value` on a `Class`.",3,null],[11,"to_str","","Returns a `&str` with the mruby `Class` name.",3,null],[11,"to_value","","Casts `Class` to `Value`.",3,null],[11,"class","","",3,null],[11,"clone","","",3,null],[11,"eq","","",3,null],[11,"fmt","","",3,null],[11,"new","","Creates a new `Repl`.",4,{"inputs":[{"name":"mrubytype"}],"output":{"name":"repl"}}],[11,"rename","","Renames a `Repl`. The command line will start with `{name}> `.",4,null],[11,"start","","Starts a `Repl`.",4,null],[11,"new","","Creates an mruby spec runner.",5,{"inputs":[{"name":"mrubytype"},{"name":"str"},{"name":"str"}],"output":{"name":"spec"}}],[11,"run","","Runs mruby specs.",5,null],[6,"MrubyType","","A `type` wrapper around a `Rc<RefCell<Mruby>>`. Created with `Mruby::new()`.",null,null],[8,"ClassLike","","A `trait` which connects `Class` & `Module`.",null,null],[10,"class","","",6,null],[8,"MrubyFile","","A `trait` useful for organising Rust types into dynamic mruby files.",null,null],[10,"require","","",7,{"inputs":[{"name":"mrubytype"}],"output":null}],[8,"MrubyImpl","","A `trait` used on `MrubyType` which implements mruby functionality.",null,null],[10,"filename","","Adds a filename to the mruby context.",8,null],[10,"run","","Runs mruby `script` on a state and context and returns a `Value` in an `Ok`\nor an `Err` containing an mruby `Exception`'s message.",8,null],[10,"run_unchecked","","Runs mruby `script` on a state and context and returns a `Value`. If an mruby Exception is\nraised, mruby will be left to handle it.\n# Examples",8,null],[10,"runb","","Runs mruby compiled (.mrb) `script` on a state and context and returns a `Value` in an `Ok`\nor an `Err` containing an mruby `Exception`'s message.",8,null],[10,"execute","","Runs mruby (compiled (.mrb) or not (.rb)) `script` on a state and context and returns a\n`Value` in an `Ok` or an `Err` containing an mruby `Exception`'s message.",8,null],[10,"raise","","Raises an mruby `RuntimeError` with `message` message and `eclass` mruby Exception Class.",8,null],[10,"is_defined","","Returns whether the mruby `Class` or `Module` named `name` is defined.",8,null],[10,"is_defined_under","","Returns whether the mruby `Class` or `Module` named `name` is defined under `outer` `Class`\nor `Module`.",8,null],[10,"get_class","","Returns the mruby `Class` named `name` in a `Some` or `None` if it is not defined.",8,null],[10,"get_class_under","","Returns the mruby `Class` named `name` under `outer` `Class` or `Module` in a `Some` or\n`None` if it is not defined.",8,null],[10,"get_module","","Returns the mruby `Module` named `name` in a `Some` or `None` if it is not defined.",8,null],[10,"get_module_under","","Returns the mruby `Module` named `name` under `outer` `Class` or `Module` in a `Some` or\n`None` if it is not defined.",8,null],[10,"def_file","","Defines a dynamic file that can be `require`d containing the Rust type `T` and runs its\n`MrubyFile`-inherited `require` method.",8,null],[10,"def_class","","Defines an mruby `Class` named `name`.",8,null],[10,"def_class_under","","Defines an mruby `Class` named `name` under `outer` `Class` or `Module`.",8,null],[10,"def_class_for","","Defines Rust type `T` as an mruby `Class` named `name`.",8,null],[10,"def_class_under_for","","Defines Rust type `T` as an mruby `Class` named `name` under `outer` `Class` or `Module`.",8,null],[10,"def_module","","Defines an mruby `Module` named `name`.",8,null],[10,"def_module_under","","Defines an mruby `Module` named `name` under `outer` `Class` or `Module`.",8,null],[10,"def_method","","Defines an mruby method named `name` on `Class` `class`. The closure to be run when the\n`name` method is called should be passed through the `mrfn!` macro.",8,null],[10,"def_class_method","","Defines an mruby class method named `name` on `Class` `class`. The closure to be run when\nthe `name` method is called should be passed through the `mrfn!` macro.",8,null],[10,"def_method_for","","Defines an mruby method named `name` on the mruby `Class` reflecting type `T`. The closure\nto be run when the `name` method is called should be passed through the `mrfn!` macro.",8,null],[10,"def_class_method_for","","Defines an mruby class method named `name` on the mruby `Class` reflecting type `T`. The\nclosure to be run when the `name` method is called should be passed through the `mrfn!`\nmacro.",8,null],[10,"class_name_for","","Return the mruby name of a previously defined Rust type `T` with `def_class`.",8,null],[10,"nil","","Creates mruby `Value` `nil`.",8,null],[10,"bool","","Creates mruby `Value` containing `true` or `false`.",8,null],[10,"fixnum","","Creates mruby `Value` of `Class` `Fixnum`.",8,null],[10,"float","","Creates mruby `Value` of `Class` `Float`.",8,null],[10,"string","","Creates mruby `Value` of `Class` `String`.",8,null],[10,"symbol","","Creates mruby `Value` of `Class` `Symbol`.",8,null],[10,"obj","","Creates mruby `Value` of `Class` `name` containing a Rust object of type `T`.",8,null],[10,"option","","Creates mruby `Value` of `Class` `name` containing a Rust `Option` of type `T`.",8,null],[10,"array","","Creates mruby `Value` of `Class` `Array`.",8,null],[8,"ReadLine","","A `trait` which performs very basic readline utility.",null,null],[10,"read","","A function that reads one line from the terminal.",9,null],[10,"add","","A function that add one line to the readline history.",9,null],[14,"mrfn!","","A `macro` useful for defining Rust closures for mruby. Requires `use mrusty::*;`.",null,null],[14,"mrusty_class!","","A `macro` that comes in handy when defining an mruby `Class` with Rust type reflection. It\nautomates and simplifies the implementation of the `MrubyFile` `trait`. Thus, any type provided\nto `mrusty_class!` will get an `MrubyFile` implementation, unlike `mruby_class!` which\nimplements a pure mruby class.",null,null],[14,"mruby_class!","","A `macro` that comes in handy when defining a pure mruby `Class`. It lets you define and\ncontrol pure mruby types and returns the newly defined `Class`, unlike `mrusty_class!` which\nalso handles Rust types.",null,null],[14,"describe!","","A `macro` useful to run mruby specs. You can pass a tuple of `MrubyFile`s dependencies\nas a second argument.",null,null],[11,"filename","","",10,null],[11,"run","","",10,null],[11,"run_unchecked","","",10,null],[11,"runb","","",10,null],[11,"execute","","",10,null],[11,"raise","","",10,null],[11,"is_defined","","",10,null],[11,"is_defined_under","","",10,null],[11,"get_class","","",10,null],[11,"get_class_under","","",10,null],[11,"get_module","","",10,null],[11,"get_module_under","","",10,null],[11,"def_file","","",10,null],[11,"def_class","","",10,null],[11,"def_class_under","","",10,null],[11,"def_class_for","","",10,null],[11,"def_class_under_for","","",10,null],[11,"def_module","","",10,null],[11,"def_module_under","","",10,null],[11,"def_method","","",10,null],[11,"def_class_method","","",10,null],[11,"def_method_for","","",10,null],[11,"def_class_method_for","","",10,null],[11,"class_name_for","","",10,null],[11,"nil","","",10,null],[11,"bool","","",10,null],[11,"fixnum","","",10,null],[11,"float","","",10,null],[11,"string","","",10,null],[11,"symbol","","",10,null],[11,"obj","","",10,null],[11,"option","","",10,null],[11,"array","","",10,null]],"paths":[[3,"Mruby"],[4,"MrubyError"],[3,"Value"],[3,"Class"],[3,"Repl"],[3,"Spec"],[8,"ClassLike"],[8,"MrubyFile"],[8,"MrubyImpl"],[8,"ReadLine"],[6,"MrubyType"]]}; initSearch(searchIndex);