pass_multiple_logicals: Flip a logical vector in Rust

Description Usage Arguments Details Value Examples

View source: R/extendr-wrappers.R

Description

Demonstrates passing a logical (boolean) vector back and forth between R and Rust, flipping the values in Rust to prove it works.

Usage

1

Arguments

b

A logical (boolean) vector to treat as an extender_api::Logical in Rust

Details

The vector passed to this function must be contain logical values, the boolean type in R, or NAs (plain NA is logical). The Rust function signature is fn pass_multiple_logicals_fn(b: Logical) -> Logical, with NA's being handled as None in Rust.

Value

!b

Examples

1
pass_multiple_logicals(c(TRUE, NA, FALSE))  # c(FALSE, NA, TRUE)

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