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::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 super::scalar::*;
pub use super::Nullable::*;

Modules§

col
Column vector type.
complex_native
Native complex floating point types whose real and imaginary parts are stored contiguously.
diag
Diagonal matrix type.
dyn_stack
Stack that allows users to allocate dynamically sized arrays.
io
De-serialization from common matrix file formats.
mat
Matrix type.
modulesDeprecated
Re-exports.
perm
Permutation matrices.
reborrow
Emulate reborrowing for user types.
row
Row vector type.
solversDeprecated
Matrix solvers and decompositions.
sparse
Sparse data structures and algorithms. Sparse matrix data structures.
stats
Statistics-related utilities.
utils
Various utilities for low level implementations in generic code.

Macros§

R
Execute R code by parsing and evaluating tokens.
Rraw
Execute R code by parsing and evaluating tokens but without expanding parameters.
array
Create an Array with one, two or three dimensions.
assert_matrix_eq
Compare matrices for exact or approximate equality.
azip
Array zip macro: lock step function application across several arrays and producers.
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.
col
Creates a col::Col containing the arguments.
concat
Concatenates the matrices in each row horizontally, then concatenates the results vertically.
concatenate
Concatenate arrays along the given axis.
data_frame
Create a dataframe.
dbgf
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.
mat
Creates a Mat containing the arguments.
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.
row
Creates a row::Row containing the arguments.
rprint
Print via the R output stream.
rprintln
Print with a newline via the R output stream.
s
Slice argument constructor.
stack
Stack arrays along the new axis.
stack_new_axisDeprecated
Stack arrays along the new axis.
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.
unzipped
Used to undo the zipping by the zipped! macro.
var
Get a local variable from the calling function or a global variable if no such variable exists.
zipped
Zips together matrix of the same size, so that coefficient-wise operations can be performed on their elements.

Structs§

ArrayBase
An n-dimensional array.
Axis
An axis index.
AxisDescription
Description of the axis, its length and its stride.
Col
Heap allocated resizable column vector.
ColMut
Mutable view over a column vector, similar to a mutable reference to a strided slice.
ColRef
Immutable view over a column vector, similar to an immutable reference to a strided slice.
Dim
Dimension description.
IterEither
Iterator that maps left or right iterators to corresponding Either-wrapped items.
IxDynImpl
Dynamic dimension or index type.
Mat
Heap allocated resizable matrix, similar to a 2D Vec.
MatMut
Mutable view over a matrix, similar to a mutable reference to a 2D strided slice.
MatRef
Immutable view over a matrix, similar to an immutable reference to a 2D strided slice.
MathCell
A transparent wrapper of Cell<T> which is identical in every way, except it will implement arithmetic operators as well.
NewAxis
Token to represent a new axis in a slice description.
OwnedArcRepr
ArcArray’s representation.
OwnedRepr
Array’s representation.
RawViewRepr
Array pointer’s representation.
Row
Heap allocated resizable row vector.
RowMut
Mutable view over a row vector, similar to a mutable reference to a strided slice.
RowRef
Immutable view over a row vector, similar to an immutable reference to a strided slice.
Scale
Factor for matrix-scalar multiplication.
Shape
A contiguous array shape of n dimensions.
ShapeError
An error related to array shape or layout.
Slice
A slice (range with step size).
SliceInfo
Represents all of the necessary information to perform a slice.
StrideShape
An array shape of n dimensions in c-order, f-order or custom strides.
ViewRepr
Array view’s representation.
Zip
Lock step function application across several arrays or other producers.

Enums§

Conj
Whether a matrix should be implicitly conjugated when read or not.
CowRepr
CowArray’s representation.
Either
The enum Either with variants Left and Right is a general purpose sum type with two cases.
ErrorKind
Error code for an error related to array shape or layout.
FoldWhile
Value controlling the execution of .fold_while on Zip.
Order
Array order
Parallelism
Parallelism strategy that can be passed to most of the routines in the library.
Side
Specifies whether the triangular lower or upper part of a matrix should be accessed.
SliceInfoElem
A slice (range with step), an index, or a new axis token.

Traits§

AsArray
Argument conversion into an array view
AssignElem
A producer element that can be assigned to once
ComplexField
Unstable trait containing the operations that a number type needs to implement.
Conjugate
Trait for types that may be implicitly conjugated.
Data
Array representation trait.
DataMut
Array representation trait.
DataOwned
Array representation trait.
DataShared
Array representation trait.
DimAdd
Adds the two dimensions at compile time.
DimMax
Dimension
Array shape and index trait.
Entity
Unstable core trait for describing how a scalar value may be split up into individual component.
FixedInitializer
Fixed-size array used for array initialization
Index
Trait for unsigned integers that can be indexed with.
IndexLonger
Extra indexing methods for array views
IntoDimension
Argument conversion a dimension.
IntoEither
Provides methods for converting a type Self into either a Left or Right variant of Either<Self, Self>.
IntoNdProducer
Argument conversion into a producer.
LinalgScalar
Elements that support linear algebra operations.
MultiSliceArg
Slicing information describing multiple mutable, disjoint slices.
NdFloat
Floating-point element types f32 and f64.
NdIndex
Tuple or fixed size arrays that can be used to index an array.
NdProducer
A producer of an n-dimensional set of elements; for example an array view, mutable array view or an iterator that yields chunks.
RawData
Array representation trait.
RawDataClone
Array representation trait.
RawDataMut
Array representation trait.
RawDataSubst
Array representation trait.
RealField
Unstable trait containing the operations that a real number type needs to implement.
RemoveAxis
Array shape with a next smaller dimension.
ScalarOperand
Elements that can be used as direct operands in arithmetic with arrays.
ShapeArg
Array shape argument with optional order parameter
ShapeBuilder
A trait for Shape and D where D: Dimension that allows customizing the memory layout (strides) of an array shape.
SignedIndex
Trait for signed integers corresponding to the ones satisfying Index.
SimpleEntity
SliceArg
A type that can slice an array of dimension D.
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.

Functions§

Dim
Create a new dimension value.
Ix0
Create a zero-dimensional index
Ix1
Create a one-dimensional index
Ix2
Create a two-dimensional index
Ix3
Create a three-dimensional index
Ix4
Create a four-dimensional index
Ix5
Create a five-dimensional index
Ix6
Create a six-dimensional index
IxDyn
Create a dynamic-dimensional index
arr0
Create a zero-dimensional array with the element x.
arr1
Create a one-dimensional array with elements from xs.
arr2
Create a two-dimensional array with elements from xs.
arr3
Create a three-dimensional array with elements from xs.
aview0
Create a zero-dimensional array view borrowing x.
aview1
Create a one-dimensional array view with elements borrowing xs.
aview2
Create a two-dimensional array view with elements borrowing xs.
aview_mut1
Create a one-dimensional read-write array view with elements borrowing xs.
aview_mut2
Create a two-dimensional read-write array view with elements borrowing xs.
concatenate
Concatenate arrays along the given axis.
disable_global_parallelism
Causes functions that access global parallelism settings to panic.
get_global_parallelism
Gets the global parallelism settings.
indices
Create an iterable of the array shape shape.
indices_of
Return an iterable of the indices of the passed-in array.
rcarr1
Create a one-dimensional array with elements from xs.
rcarr2
Create a two-dimensional array with elements from xs.
rcarr3
Create a three-dimensional array with elements from xs.
scale
Returns a factor for matrix-scalar multiplication.
set_global_parallelism
Sets the global parallelism settings.
stack
Stack arrays along the new axis.
stack_new_axisDeprecated
Stack arrays along the new axis.

Type Aliases§

ArcArray
An array where the data has shared ownership and is copy on write.
ArcArray1
one-dimensional shared ownership array
ArcArray2
two-dimensional shared ownership array
Array
An array that owns its data uniquely.
Array0
zero-dimensional array
Array1
one-dimensional array
Array2
two-dimensional array
Array3
three-dimensional array
Array4
four-dimensional array
Array5
five-dimensional array
Array6
six-dimensional array
ArrayD
dynamic-dimensional array
ArrayView
A read-only array view.
ArrayView0
zero-dimensional array view
ArrayView1
one-dimensional array view
ArrayView2
two-dimensional array view
ArrayView3
three-dimensional array view
ArrayView4
four-dimensional array view
ArrayView5
five-dimensional array view
ArrayView6
six-dimensional array view
ArrayViewD
dynamic-dimensional array view
ArrayViewMut
A read-write array view.
ArrayViewMut0
zero-dimensional read-write array view
ArrayViewMut1
one-dimensional read-write array view
ArrayViewMut2
two-dimensional read-write array view
ArrayViewMut3
three-dimensional read-write array view
ArrayViewMut4
four-dimensional read-write array view
ArrayViewMut5
five-dimensional read-write array view
ArrayViewMut6
six-dimensional read-write array view
ArrayViewMutD
dynamic-dimensional read-write array view
CowArray
An array with copy-on-write behavior.
Ix
Array index type
Ix0
zero-dimensionial
Ix1
one-dimensional
Ix2
two-dimensional
Ix3
three-dimensional
Ix4
four-dimensional
Ix5
five-dimensional
Ix6
six-dimensional
IxDyn
dynamic-dimensional
Ixs
Array index type (signed)
RawArrayView
A read-only array view without a lifetime.
RawArrayViewMut
A mutable array view without a lifetime.

Attribute Macros§

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

Derive Macros§

IntoDataFrameRow
Enable the construction of dataframes from arrays of structures.