Skip to main content

CoerceArg

Trait CoerceArg 

Source
pub trait CoerceArg: Sized {
    // Required method
    fn coerce(val: &RValue, param_name: &str) -> Result<Self, RError>;
}
Expand description

Coerce an RValue to a Rust type. Implemented for common R parameter types.

Required Methods§

Source

fn coerce(val: &RValue, param_name: &str) -> Result<Self, RError>

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.

Implementations on Foreign Types§

Source§

impl CoerceArg for bool

Source§

fn coerce(val: &RValue, param_name: &str) -> Result<Self, RError>

Source§

impl CoerceArg for f64

Source§

fn coerce(val: &RValue, param_name: &str) -> Result<Self, RError>

Source§

impl CoerceArg for i64

Source§

fn coerce(val: &RValue, param_name: &str) -> Result<Self, RError>

Source§

impl CoerceArg for usize

Source§

fn coerce(val: &RValue, param_name: &str) -> Result<Self, RError>

Source§

impl CoerceArg for String

Source§

fn coerce(val: &RValue, param_name: &str) -> Result<Self, RError>

Source§

impl<T: CoerceArg> CoerceArg for Option<T>

Option<T> coerces the value if present, but returns None for NULL. Missing args are handled by the derive (never reach CoerceArg).

Source§

fn coerce(val: &RValue, param_name: &str) -> Result<Self, RError>

Implementors§