pass_multiple_characters: Uppercase a character vector in Rust

Description Usage Arguments Details Value Examples

View source: R/extendr-wrappers.R

Description

Demonstrates passing a character (string) vector back and forth between R and Rust, uppercasing the string in Rust to prove it works.

Usage

1

Arguments

s

A character vector to treat as strings in Rust

Details

The vector passed to this function must be contain character values. The Rust function signature is pass_multiple_characters_fn(s: Vec<String>) -> Vec<String>. extendr_api(v0.2.0) current does not support a method (I could find) for passing character vectors with NA's, so NA handling will need te be managed on the R side for now.

Value

toupper(s)

Examples

1
pass_multiple_characters(c("hello", "world"))  # c("HELLO", "WORLD")

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