Module prelude

Source
Expand description

§Common exports for extendr-api.

This allows us to be more selective about exports and avoid users using deprecated features.

Re-exports§

pub use super::CanBeNA;
pub use super::Rtype;
pub use super::FALSE;
pub use super::NA_INTEGER;
pub use super::NA_LOGICAL;
pub use super::NA_REAL;
pub use super::NA_STRING;
pub use super::NULL;
pub use super::TRUE;
pub use super::error::Error;
pub use super::error::Result;
pub use super::functions::base_env;
pub use super::functions::base_namespace;
pub use super::functions::blank_scalar_string;
pub use super::functions::blank_string;
pub use super::functions::current_env;
pub use super::functions::empty_env;
pub use super::functions::eval_string;
pub use super::functions::eval_string_with_params;
pub use super::functions::find_namespace;
pub use super::functions::find_namespaced_function;
pub use super::functions::global_env;
pub use super::functions::global_function;
pub use super::functions::na_string;
pub use super::functions::namespace_registry;
pub use super::functions::new_env;
pub use super::functions::nil_value;
pub use super::functions::parse;
pub use super::functions::srcref;
pub use super::wrapper::symbol::base_symbol;
pub use super::wrapper::symbol::brace_symbol;
pub use super::wrapper::symbol::bracket_2_symbol;
pub use super::wrapper::symbol::bracket_symbol;
pub use super::wrapper::symbol::class_symbol;
pub use super::wrapper::symbol::device_symbol;
pub use super::wrapper::symbol::dim_symbol;
pub use super::wrapper::symbol::dimnames_symbol;
pub use super::wrapper::symbol::dollar_symbol;
pub use super::wrapper::symbol::dot_defined;
pub use super::wrapper::symbol::dot_method;
pub use super::wrapper::symbol::dot_package_name;
pub use super::wrapper::symbol::dot_target;
pub use super::wrapper::symbol::dots_symbol;
pub use super::wrapper::symbol::double_colon_symbol;
pub use super::wrapper::symbol::lastvalue_symbol;
pub use super::wrapper::symbol::levels_symbol;
pub use super::wrapper::symbol::missing_arg;
pub use super::wrapper::symbol::mode_symbol;
pub use super::wrapper::symbol::na_rm_symbol;
pub use super::wrapper::symbol::name_symbol;
pub use super::wrapper::symbol::names_symbol;
pub use super::wrapper::symbol::namespace_env_symbol;
pub use super::wrapper::symbol::package_symbol;
pub use super::wrapper::symbol::previous_symbol;
pub use super::wrapper::symbol::quote_symbol;
pub use super::wrapper::symbol::row_names_symbol;
pub use super::wrapper::symbol::seeds_symbol;
pub use super::wrapper::symbol::sort_list_symbol;
pub use super::wrapper::symbol::source_symbol;
pub use super::wrapper::symbol::spec_symbol;
pub use super::wrapper::symbol::triple_colon_symbol;
pub use super::wrapper::symbol::tsp_symbol;
pub use super::wrapper::symbol::unbound_value;
pub use crate::lang;
pub use crate::lang;
pub use crate::list;
pub use super::wrapper::AltComplexImpl;
pub use super::wrapper::AltIntegerImpl;
pub use super::wrapper::AltLogicalImpl;
pub use super::wrapper::AltRawImpl;
pub use super::wrapper::AltRealImpl;
pub use super::wrapper::AltStringImpl;
pub use super::wrapper::Altrep;
pub use super::wrapper::AltrepImpl;
pub use super::wrapper::RArray;
pub use super::wrapper::RColumn;
pub use super::wrapper::RMatrix;
pub use super::wrapper::RMatrix3D;
pub use super::wrapper::RMatrix4D;
pub use super::wrapper::RMatrix5D;
pub use super::wrapper::AltListImpl;
pub use super::wrapper::s4::S4;
pub use super::wrapper::Conversions;
pub use super::wrapper::MatrixConversions;
pub use super::robj::AsStrIter;
pub use super::robj::Attributes;
pub use super::robj::Eval;
pub use super::robj::GetSexp;
pub use super::robj::IntoRobj;
pub use super::robj::Length;
pub use super::robj::Operators;
pub use super::robj::Rinternals;
pub use super::robj::Robj;
pub use super::robj::RobjItertools;
pub use super::robj::Slices;
pub use super::robj::Types;
pub use super::thread_safety::catch_r_error;
pub use super::thread_safety::single_threaded;
pub use super::thread_safety::throw_r_error;
pub use super::wrapper::Complexes;
pub use super::wrapper::Dataframe;
pub use super::wrapper::Doubles;
pub use super::wrapper::EnvIter;
pub use super::wrapper::Environment;
pub use super::wrapper::Expressions;
pub use super::wrapper::ExternalPtr;
pub use super::wrapper::FromList;
pub use super::wrapper::Function;
pub use super::wrapper::Integers;
pub use super::wrapper::IntoDataFrameRow;
pub use super::wrapper::Language;
pub use super::wrapper::List;
pub use super::wrapper::ListIter;
pub use super::wrapper::Logicals;
pub use super::wrapper::Nullable;
pub use super::wrapper::Pairlist;
pub use super::wrapper::Primitive;
pub use super::wrapper::Promise;
pub use super::wrapper::Raw;
pub use super::wrapper::Rstr;
pub use super::wrapper::Strings;
pub use super::wrapper::Symbol;
pub use super::iter::StrIter;
pub use ::ndarray;
pub use ::faer;
pub use super::scalar::*;
pub use super::Nullable::*;

Macros§

R
Execute R code by parsing and evaluating tokens.
Rraw
Execute R code by parsing and evaluating tokens but without expanding parameters.
call
Call a function or primitive defined by a text expression with arbitrary parameters. This currently works by parsing and evaluating the string in R, but will probably acquire some shortcuts for simple expressions, for example by caching symbols and constant values.
data_frame
Create a dataframe.
extendr_module
Define a module and export symbols to R Example:
factor
Create a factor.
for_both
Evaluate the provided expression for both Either::Left and Either::Right.
global
Get a global variable.
lang
A macro for constructing R language objects.
list
Create a List R object from a list of name-value pairs.
pairlist
Create a Pairlist R object from a list of name-value pairs.
r
Convert a rust expression to an R object.
reprint
Print via the R error stream.
reprintln
Print with a newline via the R output stream.
rprint
Print via the R output stream.
rprintln
Print with a newline via the R output stream.
sym
The sym! macro install symbols. You should cache your symbols in variables as generating them is costly.
test
Macro for running tests.
try_left
Macro for unwrapping the left side of an Either, which fails early with the opposite side. Can only be used in functions that return Either because of the early return of Right that it provides.
try_right
Dual to try_left!, see its documentation for more information.
var
Get a local variable from the calling function or a global variable if no such variable exists.

Structs§

IterEither
Iterator that maps left or right iterators to corresponding Either-wrapped items.

Enums§

Either
The enum Either with variants Left and Right is a general purpose sum type with two cases.

Traits§

IntoEither
Provides methods for converting a type Self into either a Left or Right variant of Either<Self, Self>.
TryFrom
Simple and safe type conversions that may fail in a controlled way under some circumstances. It is the reciprocal of TryInto.
TryInto
An attempted conversion that consumes self, which may or may not be expensive.

Attribute Macros§

extendr
The #[extendr]-macro may be placed on three items

Derive Macros§

IntoDataFrameRow
Enable the construction of dataframes from arrays of structures.