make_module_macro: Generate extendr module macro for Rust source

Description Usage Arguments Details Value

View source: R/make_module_macro.R

Description

Read some Rust source code, find functions or implementations with the #[extendr] attribute, and generate an extendr_module! macro statement.

Usage

1
make_module_macro(code, module_name = "rextendr")

Arguments

code

Character vector containing Rust code.

module_name

Module name

Details

This function uses simple regular expressions to do the Rust parsing and can get confused by valid Rust code. It is only meant as a convenience for simple use cases. In particular, it cannot currently handle implementations for generics.

Value

Character vector holding the contents of the generated macro statement.


rextendr documentation built on June 15, 2021, 5:06 p.m.