rb_define_hooked_variable

Function rb_define_hooked_variable 

Source
pub unsafe extern "C" fn rb_define_hooked_variable(
    name: *const c_char,
    var: *mut VALUE,
    getter: rb_gvar_getter_t,
    setter: rb_gvar_setter_t,
)
Expand description

Identical to rb_define_virtual_variable, but can also specify a storage. A programmer can use the storage for e.g. memoisation, storing intermediate computation result, etc.

Also you can pass 0 to this function, unlike other variants:

§@param[in] name Variable name, in C’s string. @param[in] var Variable storage. @param[in] getter A getter function. @param[in] setter A setter function. @post Ruby level global variable named name is defined if absent.

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3