[−][src]Type Definition mruby::Mrb
type Mrb = Rc<RefCell<State>>;
Interpreter instance.
The interpreter State
is wrapped in an Rc<RefCell<_>>
.
The Rc
enables the State to be cloned so it can be stored in the
sys::mrb_state
,
extracted in extern "C"
functions, and used in
Value
instances.
The RefCell
enables mutable access to the underlying
State
, even across an FFI boundary.
Functionality is added to the interpreter via traits, for example, garbage collection or eval.
Trait Implementations
impl MrbEval for Mrb
[src]
fn eval<T>(&self, code: T) -> Result<Value, MrbError> where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
fn unchecked_eval<T>(&self, code: T) -> Value where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
fn eval_with_context<T>(
&self,
code: T,
context: EvalContext
) -> Result<Value, MrbError> where
T: AsRef<[u8]>,
[src]
&self,
code: T,
context: EvalContext
) -> Result<Value, MrbError> where
T: AsRef<[u8]>,
fn unchecked_eval_with_context<T>(&self, code: T, context: EvalContext) -> Value where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
fn peek_context(&self) -> Option<EvalContext>
[src]
fn push_context(&self, context: EvalContext)
[src]
fn pop_context(&self)
[src]
impl MrbExceptionHandler for Mrb
[src]
fn last_error(&self) -> LastError
[src]
impl MrbGarbageCollection for Mrb
[src]
fn create_arena_savepoint(&self) -> ArenaIndex
[src]
fn live_object_count(&self) -> i32
[src]
fn incremental_gc(&self)
[src]
fn full_gc(&self)
[src]
fn enable_gc(&self) -> bool
[src]
fn disable_gc(&self) -> bool
[src]
impl MrbLoadSources for Mrb
[src]
fn def_file<T>(
&self,
filename: T,
require: fn(_: Self) -> Result<(), MrbError>
) -> Result<(), MrbError> where
T: AsRef<str>,
[src]
&self,
filename: T,
require: fn(_: Self) -> Result<(), MrbError>
) -> Result<(), MrbError> where
T: AsRef<str>,
fn def_file_for_type<T, F>(&self, filename: T) -> Result<(), MrbError> where
T: AsRef<str>,
F: MrbFile,
[src]
T: AsRef<str>,
F: MrbFile,
fn def_rb_source_file<T, F>(
&self,
filename: T,
contents: F
) -> Result<(), MrbError> where
T: AsRef<str>,
F: AsRef<[u8]>,
[src]
&self,
filename: T,
contents: F
) -> Result<(), MrbError> where
T: AsRef<str>,
F: AsRef<[u8]>,
fn normalize_source_path<T>(&self, filename: T) -> PathBuf where
T: AsRef<str>,
[src]
T: AsRef<str>,
Normalize path of a Ruby source to be relative to RUBY_LOAD_PATH
unless the path is absolute. Read more