extendr_api::robj

Trait ToVectorValue

Source
pub trait ToVectorValue {
    // Provided methods
    fn sexptype() -> SEXPTYPE { ... }
    fn to_real(&self) -> f64
       where Self: Sized { ... }
    fn to_complex(&self) -> Rcomplex
       where Self: Sized { ... }
    fn to_integer(&self) -> i32
       where Self: Sized { ... }
    fn to_logical(&self) -> i32
       where Self: Sized { ... }
    fn to_raw(&self) -> u8
       where Self: Sized { ... }
    fn to_sexp(&self) -> SEXP
       where Self: Sized { ... }
}
Expand description

ToVectorValue is a trait that allows many different types to be converted to vectors. It is used as a type parameter to collect_robj().

Provided Methods§

Source

fn sexptype() -> SEXPTYPE

Source

fn to_real(&self) -> f64
where Self: Sized,

Source

fn to_complex(&self) -> Rcomplex
where Self: Sized,

Source

fn to_integer(&self) -> i32
where Self: Sized,

Source

fn to_logical(&self) -> i32
where Self: Sized,

Source

fn to_raw(&self) -> u8
where Self: Sized,

Source

fn to_sexp(&self) -> SEXP
where Self: Sized,

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 ToVectorValue for &&str

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_sexp(&self) -> SEXP
where Self: Sized,

Source§

impl ToVectorValue for &(f64, f64)

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_complex(&self) -> Rcomplex

Source§

impl ToVectorValue for &bool

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_logical(&self) -> i32
where Self: Sized,

Source§

impl ToVectorValue for &f32

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for &f64

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for &i8

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for &i16

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for &i32

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for &i64

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for &str

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_sexp(&self) -> SEXP
where Self: Sized,

Source§

impl ToVectorValue for &u8

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_raw(&self) -> u8

Source§

impl ToVectorValue for &u16

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for &u32

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for &u64

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for &usize

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for &String

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_sexp(&self) -> SEXP
where Self: Sized,

Source§

impl ToVectorValue for (f64, f64)

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_complex(&self) -> Rcomplex

Source§

impl ToVectorValue for Option<&str>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_sexp(&self) -> SEXP
where Self: Sized,

Source§

impl ToVectorValue for Option<bool>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_logical(&self) -> i32

Source§

impl ToVectorValue for Option<f32>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for Option<f64>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for Option<i8>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for Option<i16>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for Option<i32>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for Option<i64>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for Option<u16>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for Option<u32>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for Option<u64>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for Option<usize>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for Option<String>

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_sexp(&self) -> SEXP
where Self: Sized,

Source§

impl ToVectorValue for bool

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_logical(&self) -> i32
where Self: Sized,

Source§

impl ToVectorValue for f32

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for f64

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for i8

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for i16

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for i32

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for i64

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for u8

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_raw(&self) -> u8

Source§

impl ToVectorValue for u16

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_integer(&self) -> i32

Source§

impl ToVectorValue for u32

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for u64

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for usize

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_real(&self) -> f64

Source§

impl ToVectorValue for String

Source§

fn sexptype() -> SEXPTYPE

Source§

fn to_sexp(&self) -> SEXP
where Self: Sized,

Implementors§