rb_sys

Module macros

Source
Expand description

Implementation of Ruby macros.

Since macros are rely on the C preprocessor, or defined as inline C functions, they are not available when linking libruby. In order to use the libruby macros from Rust, rb-sys implements them using the following strategies:

  1. For stable versions of Ruby, the macros are implemented as Rust functions
  2. For ruby-head, the macros are implemented as C functions that are linked into the crate.

Functions§

  • Checks if the given object is a so-called Fixnum.
  • Checks if the given object is a so-called Flonum.
  • Checks if the given object is an immediate i.e. an object which has no corresponding storage inside of the object space.
  • Checks if the given object is nil.
  • Get the backend storage of a Ruby array.
  • Get the length of a Ruby array.
  • Queries the type of the object.
  • Queries if the object is a dynamic symbol.
  • Queries if the object is an instance of ::rb_cFloat.
  • Queries if the object is an instance of ::rb_cInteger.
  • Queries if the object is an instance of ::rb_cSymbol.
  • Identical to RB_BUILTIN_TYPE(), except it can also accept special constants.
  • Queries if the given object is of given type.
  • Get the length of a Ruby string.
  • Get the backend storage of a Ruby string.
  • Checks if the given object is of enum ::ruby_special_consts.
  • Checks if the given object is a static symbol.
  • Emulates Ruby’s “if” statement.