[][src]Type Definition mruby::def::Method

type Method = unsafe extern "C" fn(mrb: *mut mrb_state, slf: mrb_value) -> mrb_value;

Typedef for a method exposed in the mruby interpreter.

This function signature is used for all types of mruby methods, including instance methods, class methods, singleton methods, and global methods.

slf is the method receiver, e.g. s in the following invocation of String#start_with?.

s = 'mruby crate'
s.start_with?('mruby')

To extract method arguments, use sys::mrb_get_args and the suppilied interpreter.