rust_fn {cargo} | R Documentation |
Define an R Function Implemented in Rust
Description
This function takes Rust code as a string from the last unnamed argument, takes variable names for all other unnamed arguments, compiles the Rust function, and wraps it as an R function.
Usage
rust_fn(
...,
dependencies = character(0),
minimum_version = "1.31.0",
verbose = FALSE,
cached = TRUE,
longjmp = TRUE,
invisible = FALSE,
force = FALSE
)
Arguments
... |
Rust code is taken as a string from the last unnamed argument, and variable names come for all other unnamed arguments. See example. |
dependencies |
A character vector of crate dependencies, e.g.,
|
minimum_version |
A character string representing the minimum version of
Rust that is needed. Or a path to the root of a package (i.e., the
directory containing the DESCRIPTION file), in which case the value is
found from the field: |
verbose |
If |
cached |
Should Cargo use previously compiled artifacts? |
longjmp |
Should the compiled function use the faster (but experimental) longjmp functionality when Rust code panics? |
invisible |
Should the compiled function return values invisibly? |
force |
If |
Value
An R function implemented with the supplied Rust code.