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:
- For stable versions of Ruby, the macros are implemented as Rust functions
- For ruby-head, the macros are implemented as C functions that are linked into the crate.
Functions§
- FIXNUM_
P - Checks if the given object is a so-called Fixnum.
- FLONUM_
P - Checks if the given object is a so-called Flonum.
- IMMEDIATE_
P - Checks if the given object is an immediate i.e. an object which has no corresponding storage inside of the object space.
- NIL_P
- Checks if the given object is nil.
- RARRAY_
CONST_ ⚠PTR - Get the backend storage of a Ruby array.
- RARRAY_
LEN ⚠ - Get the length of a Ruby array.
- RB_
BUILTIN_ ⚠TYPE - Queries the type of the object.
- RB_
DYNAMIC_ ⚠SYM_ P - Queries if the object is a dynamic symbol.
- RB_
FLOAT_ ⚠TYPE_ P - Queries if the object is an instance of ::rb_cFloat.
- RB_
INTEGER_ ⚠TYPE_ P - Queries if the object is an instance of ::rb_cInteger.
- RB_
SYMBOL_ ⚠P - Queries if the object is an instance of ::rb_cSymbol.
- RB_TYPE⚠
- Identical to RB_BUILTIN_TYPE(), except it can also accept special constants.
- RB_
TYPE_ ⚠P - Queries if the given object is of given type.
- RSTRING_
LEN ⚠ - Get the length of a Ruby string.
- RSTRING_
PTR ⚠ - Get the backend storage of a Ruby string.
- SPECIAL_
CONST_ P - Checks if the given object is of enum ::ruby_special_consts.
- STATIC_
SYM_ P - Checks if the given object is a static symbol.
- TEST
- Emulates Ruby’s “if” statement.