Function rb_define_readonly_variable

Source
pub unsafe extern "C" fn rb_define_readonly_variable(
    name: *const c_char,
    var: *const VALUE,
)
Expand description

Identical to rb_define_variable, except it does not allow Ruby programs to assign values to such global variable. C codes can still set values at will. This could be handy for you when implementing an errno-like experience, where a method updates a read-only global variable as a side- effect.

ยง@param[in] name Variable (Ruby side). @param[in] var Variable (C side). @post Ruby level global variable named name is defined if absent, and its storage is set to var.

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