pub trait Rinternals: Types + Conversions {
Show 61 methods
// Provided methods
fn is_null(&self) -> bool { ... }
fn is_symbol(&self) -> bool { ... }
fn is_logical(&self) -> bool { ... }
fn is_real(&self) -> bool { ... }
fn is_complex(&self) -> bool { ... }
fn is_expressions(&self) -> bool { ... }
fn is_environment(&self) -> bool { ... }
fn is_promise(&self) -> bool { ... }
fn is_string(&self) -> bool { ... }
fn is_object(&self) -> bool { ... }
fn is_s4(&self) -> bool { ... }
fn is_external_pointer(&self) -> bool { ... }
fn get_current_srcref(val: i32) -> Robj { ... }
fn get_src_filename(&self) -> Robj { ... }
fn as_character_vector(&self) -> Robj { ... }
fn coerce_vector(&self, sexptype: SEXPTYPE) -> Robj { ... }
fn pair_to_vector_list(&self) -> Robj { ... }
fn vector_to_pair_list(&self) -> Robj { ... }
fn as_character_factor(&self) -> Robj { ... }
fn alloc_matrix(sexptype: SEXPTYPE, rows: i32, cols: i32) -> Robj { ... }
fn duplicate(&self) -> Robj { ... }
fn find_function<K: TryInto<Symbol, Error = Error>>(
&self,
key: K,
) -> Result<Robj> { ... }
fn find_var<K: TryInto<Symbol, Error = Error>>(
&self,
key: K,
) -> Result<Robj> { ... }
fn ncols(&self) -> usize { ... }
fn nrows(&self) -> usize { ... }
fn xlengthgets(&self, new_len: usize) -> Result<Robj> { ... }
fn alloc_vector(sexptype: SEXPTYPE, len: usize) -> Robj { ... }
fn conformable(a: &Robj, b: &Robj) -> bool { ... }
fn is_array(&self) -> bool { ... }
fn is_factor(&self) -> bool { ... }
fn is_frame(&self) -> bool { ... }
fn is_function(&self) -> bool { ... }
fn is_integer(&self) -> bool { ... }
fn is_language(&self) -> bool { ... }
fn is_pairlist(&self) -> bool { ... }
fn is_matrix(&self) -> bool { ... }
fn is_list(&self) -> bool { ... }
fn is_number(&self) -> bool { ... }
fn is_primitive(&self) -> bool { ... }
fn is_ts(&self) -> bool { ... }
fn is_user_binop(&self) -> bool { ... }
fn is_vector(&self) -> bool { ... }
fn is_vector_atomic(&self) -> bool { ... }
fn is_vector_list(&self) -> bool { ... }
fn is_vectorizable(&self) -> bool { ... }
fn is_raw(&self) -> bool { ... }
fn is_char(&self) -> bool { ... }
fn is_missing_arg(&self) -> bool { ... }
fn is_unbound_value(&self) -> bool { ... }
fn is_package_env(&self) -> bool { ... }
fn package_env_name(&self) -> Robj { ... }
fn is_namespace_env(&self) -> bool { ... }
fn namespace_env_spec(&self) -> Robj { ... }
fn is_altrep(&self) -> bool { ... }
fn is_altinteger(&self) -> bool { ... }
fn is_altreal(&self) -> bool { ... }
fn is_altlogical(&self) -> bool { ... }
fn is_altraw(&self) -> bool { ... }
fn is_altstring(&self) -> bool { ... }
fn is_altlist(&self) -> bool { ... }
fn deparse(&self) -> Result<String> { ... }
}
Expand description
The following impls wrap specific Rinternals.h functions.
Provided Methods§
Sourcefn is_logical(&self) -> bool
fn is_logical(&self) -> bool
Return true if this is a boolean (logical) vector
Sourcefn is_complex(&self) -> bool
fn is_complex(&self) -> bool
Return true if this is a complex vector.
Sourcefn is_expressions(&self) -> bool
fn is_expressions(&self) -> bool
Return true if this is an expression.
Sourcefn is_environment(&self) -> bool
fn is_environment(&self) -> bool
Return true if this is an environment.
Sourcefn is_promise(&self) -> bool
fn is_promise(&self) -> bool
Return true if this is an environment.
Sourcefn is_external_pointer(&self) -> bool
fn is_external_pointer(&self) -> bool
Return true if this is an expression.
Sourcefn get_current_srcref(val: i32) -> Robj
fn get_current_srcref(val: i32) -> Robj
Get the source ref.
Sourcefn get_src_filename(&self) -> Robj
fn get_src_filename(&self) -> Robj
Get the source filename.
Sourcefn as_character_vector(&self) -> Robj
fn as_character_vector(&self) -> Robj
Convert to a string vector.
Sourcefn coerce_vector(&self, sexptype: SEXPTYPE) -> Robj
fn coerce_vector(&self, sexptype: SEXPTYPE) -> Robj
Convert to vectors of many kinds.
Sourcefn pair_to_vector_list(&self) -> Robj
fn pair_to_vector_list(&self) -> Robj
Convert a pairlist (LISTSXP) to a vector list (VECSXP).
Sourcefn vector_to_pair_list(&self) -> Robj
fn vector_to_pair_list(&self) -> Robj
Convert a vector list (VECSXP) to a pair list (LISTSXP)
Sourcefn as_character_factor(&self) -> Robj
fn as_character_factor(&self) -> Robj
Convert a factor to a string vector.
Sourcefn alloc_matrix(sexptype: SEXPTYPE, rows: i32, cols: i32) -> Robj
fn alloc_matrix(sexptype: SEXPTYPE, rows: i32, cols: i32) -> Robj
Allocate a matrix object.
Sourcefn duplicate(&self) -> Robj
fn duplicate(&self) -> Robj
Do a deep copy of this object. Note that clone() only adds a reference.
Sourcefn find_function<K: TryInto<Symbol, Error = Error>>(
&self,
key: K,
) -> Result<Robj>
fn find_function<K: TryInto<Symbol, Error = Error>>( &self, key: K, ) -> Result<Robj>
Find a function in an environment ignoring other variables.
This evaulates promises if they are found.
See also global_function().
use extendr_api::prelude::*;
test! {
let my_fun = base_env().find_function(sym!(ls)).unwrap();
assert_eq!(my_fun.is_function(), true);
// Note: this may crash on some versions of windows which don't support unwinding.
// assert!(base_env().find_function(sym!(qwertyuiop)).is_none());
}
Sourcefn find_var<K: TryInto<Symbol, Error = Error>>(&self, key: K) -> Result<Robj>
fn find_var<K: TryInto<Symbol, Error = Error>>(&self, key: K) -> Result<Robj>
Find a variable in an environment.
Note that many common variables and functions are contained in promises which must be evaluated and this function may throw an R error.
Sourcefn xlengthgets(&self, new_len: usize) -> Result<Robj>
fn xlengthgets(&self, new_len: usize) -> Result<Robj>
Copy a vector and resize it. See. https://github.com/hadley/r-internals/blob/master/vectors.md
Sourcefn alloc_vector(sexptype: SEXPTYPE, len: usize) -> Robj
fn alloc_vector(sexptype: SEXPTYPE, len: usize) -> Robj
Allocated an owned object of a certain type.
Sourcefn conformable(a: &Robj, b: &Robj) -> bool
fn conformable(a: &Robj, b: &Robj) -> bool
Return true if two arrays have identical dims.
Sourcefn is_function(&self) -> bool
fn is_function(&self) -> bool
Return true if this is a function or a primitive (CLOSXP, BUILTINSXP or SPECIALSXP)
Sourcefn is_integer(&self) -> bool
fn is_integer(&self) -> bool
Return true if this is an integer vector (INTSXP) but not a factor.
Sourcefn is_language(&self) -> bool
fn is_language(&self) -> bool
Return true if this is a language object (LANGSXP).
Sourcefn is_pairlist(&self) -> bool
fn is_pairlist(&self) -> bool
Return true if this is NILSXP or LISTSXP.
Sourcefn is_primitive(&self) -> bool
fn is_primitive(&self) -> bool
Return true if this is a primitive function BUILTINSXP, SPECIALSXP.
Sourcefn is_user_binop(&self) -> bool
fn is_user_binop(&self) -> bool
Return true if this is a user defined binop.
Sourcefn is_vector_atomic(&self) -> bool
fn is_vector_atomic(&self) -> bool
Return true if this is an atomic vector.
Sourcefn is_vector_list(&self) -> bool
fn is_vector_list(&self) -> bool
Return true if this is a vector list.
Sourcefn is_vectorizable(&self) -> bool
fn is_vectorizable(&self) -> bool
Return true if this is can be made into a vector.
fn is_missing_arg(&self) -> bool
fn is_unbound_value(&self) -> bool
fn is_package_env(&self) -> bool
fn package_env_name(&self) -> Robj
fn is_namespace_env(&self) -> bool
fn namespace_env_spec(&self) -> Robj
Sourcefn is_altinteger(&self) -> bool
fn is_altinteger(&self) -> bool
Returns true
if this is an integer ALTREP object.
Sourcefn is_altreal(&self) -> bool
fn is_altreal(&self) -> bool
Returns true
if this is an real ALTREP object.
Sourcefn is_altlogical(&self) -> bool
fn is_altlogical(&self) -> bool
Returns true
if this is an logical ALTREP object.
Sourcefn is_altstring(&self) -> bool
fn is_altstring(&self) -> bool
Returns true
if this is an integer ALTREP object.
Sourcefn is_altlist(&self) -> bool
fn is_altlist(&self) -> bool
Returns true
if this is an integer ALTREP object.
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§
impl Rinternals for Altrep
find_var() etc.
impl Rinternals for Complexes
find_var() etc.
impl Rinternals for Doubles
find_var() etc.
impl Rinternals for Environment
find_var() etc.
impl Rinternals for Expressions
find_var() etc.
impl Rinternals for Function
find_var() etc.
impl Rinternals for Integers
find_var() etc.
impl Rinternals for Language
find_var() etc.
impl Rinternals for List
find_var() etc.
impl Rinternals for Logicals
find_var() etc.
impl Rinternals for Pairlist
find_var() etc.
impl Rinternals for Primitive
find_var() etc.
impl Rinternals for Promise
find_var() etc.
impl Rinternals for Raw
find_var() etc.
impl Rinternals for Rstr
find_var() etc.
impl Rinternals for S4
find_var() etc.
impl Rinternals for Strings
find_var() etc.
impl Rinternals for Symbol
find_var() etc.
impl Rinternals for Robj
impl<T> Rinternals for Dataframe<T>
find_var() etc.
impl<T> Rinternals for ExternalPtr<T>
find_var() etc.