Skip to main content

AsRNativeExt

Trait AsRNativeExt 

Source
pub trait AsRNativeExt: RNativeType + Sized {
    // Provided method
    fn wrap_r_native(self) -> AsRNative<Self> { ... }
}
Expand description

Extension trait for wrapping values as AsRNative.

This trait is automatically implemented for all types that implement RNativeType.

§Example

use miniextendr_api::convert::AsRNativeExt;

let x: f64 = 42.5;
let wrapped: AsRNative<f64> = x.wrap_r_native();

Provided Methods§

Source

fn wrap_r_native(self) -> AsRNative<Self>

Wrap self in AsRNative for native R scalar conversion.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§