pass_single_integer: Multiplies an integer by 10 in Rust

Description Usage Arguments Details Value Examples

View source: R/extendr-wrappers.R

Description

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

Usage

1

Arguments

n

An integer value to treat as an i32 in Rust

Details

The value passed to this fuction must be an integer (from as.integer(n)) or an NA_integer_. The Rust function signature is fn pass_single_integer(n: Option<i32>) -> Option<i32>, with NA's being handled as None in Rust. The native R integer is also a signed 32-bit integer, which is equivalent to Rust's i32.

Value

n * 10

Examples

1
2

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