Expand description
This is responsible for generating the C functions that act as wrappers of the exported Rust functions.
extendr relies on the .Call-interface
In short, it is necessary the the signature of the C-function have SEXP
as the type for return type, and argument types.
For instance, if your function returns nothing, the return type is not
allowed to be void, instead SEXP must be used, and one should return
R_NilValue.
ยงR wrappers
Within R, you may call rextendr::document() to generate R functions,
that use the .Call-interface, to call the wrapped Rust functions.
You may also manually implement these wrappers, in order to do special
type-checking, or other annotation, that could be more convenient to do
on the R-side. The C-functions are named according to "{WRAP_PREFIX}{prefix}{mod_name}".
See WRAP_PREFIX, and note that prefix is set specifically for methods in
extendr-impl blocks, while for functions have no prefix.
Structsยง
- STRUCT_
DOCS ๐
Constantsยง
Functionsยง
- get_
defaults ๐ - get_
doc_ string - get_
named_ ๐lit - get_
return_ type - get_
struct_ doc - Retrieve the structโlevel docs (or empty if none).
- make_
function_ ๐wrappers - mangled_
type_ name - register_
struct_ doc - Called by the structโlevel #[extendr] macro to register docstrings.
- sanitize_
identifier ๐ - translate_
actual ๐ - translate_
formal - translate_
meta_ ๐arg - translate_
only_ ๐alias - Returns only the alias from a function argument.
- translate_
to_ ๐robj - Convert
SEXParguments intoRobj. This maintains the lifetime of references. - type_
name - Return a simplified type name that will be meaningful to R. Defaults to a digest.
- type_
needs_ ๐mut_ robj