pass_multiple_integers: Multiplies an integer vector by 10 in Rust

Description Usage Arguments Details Value Examples

View source: R/extendr-wrappers.R

Description

Demonstrates passing an integer vector back and forth between R and Rust, multiplies each element by 10 in Rust to prove it works.

Usage

1

Arguments

n

An integer vector to treat as an extendr_api::Int in Rust

Details

The vector passed to this function must be an integer (from as.integer(n)) or an NA_integer_. The Rust function signature is fn pass_multiple_integers(n: Int) -> Int. In the current version of extendr-api (0.2.0), NA's are implicitly converted to 0's, so if you need NA handling you'll need to take care of that yourself for now.

Value

n * 10

Examples

1
2
3

ericwburden/rustbind documentation built on April 10, 2021, 12:31 p.m.