[][src]Trait mruby::def::Define

pub trait Define where
    Self: ClassLike
{ fn define(&self, interp: &Mrb) -> Result<*mut RClass, MrbError>; }

Define trait allows a type to install classes, modules, and methods into an mruby interpreter.

Required methods

fn define(&self, interp: &Mrb) -> Result<*mut RClass, MrbError>

Define the class or module and all of its methods into the interpreter.

Returns the RClass * of the newly defined item.

This function takes a mutable borrow on the Mrb interpreter. Ensure that there are no outstanding borrows on the interpreter or else Rust will panic.

Loading content...

Implementors

impl Define for mruby::class::Spec[src]

impl Define for mruby::module::Spec[src]

Loading content...