Skip to main content

Module prelude

Module prelude 

Source
Expand description

Convenience re-exports for common miniextendr items.

A single use miniextendr_api::prelude::*; brings into scope the most commonly used macros, traits, types, and helpers. Convenience re-exports for common miniextendr items.

A single use miniextendr_api::prelude::*; brings into scope the most commonly used macros, traits, types, and helpers so user crates can avoid a long list of individual imports.

§Optional feature types

When a Cargo feature is enabled (e.g., uuid, regex, ndarray), the prelude includes both the miniextendr adapter types and a re-export of the upstream dependency crate itself. This means you do not need to add optional crates as direct dependencies in your Cargo.toml — enabling the feature on miniextendr-api is enough.

[dependencies]
miniextendr-api = { version = "0.1", features = ["uuid", "ndarray"] }
# No need for: uuid = "1", ndarray = "0.16"

Access the upstream crate via the prelude:

use miniextendr_api::prelude::*;

// Uuid is re-exported from the uuid crate
let id = Uuid::new_v4();

// The full crate is also available for advanced usage
let parsed = uuid::Uuid::parse_str("...").unwrap();

§Example

use miniextendr_api::prelude::*;

#[miniextendr]
fn add(a: i32, b: i32) -> i32 {
    a + b
}

Re-exports§

pub use crate::Altrep;
pub use crate::ExternalPtr;
pub use crate::MatchArg;
pub use crate::RFactor;
pub use crate::list;
pub use crate::typed_list;
pub use crate::altrep::RegisterAltrep;
pub use crate::AltComplexData;
pub use crate::AltIntegerData;
pub use crate::AltListData;
pub use crate::AltLogicalData;
pub use crate::AltRawData;
pub use crate::AltRealData;
pub use crate::AltStringData;
pub use crate::AltrepExtract;
pub use crate::AltrepLen;
pub use crate::Coerce;
pub use crate::IntoR;
pub use crate::IntoRAltrep;
pub use crate::TryCoerce;
pub use crate::TryFromSexp;
pub use crate::IntoList;
pub use crate::Lazy;
pub use crate::List;
pub use crate::ListBuilder;
pub use crate::ListMut;
pub use crate::Missing;
pub use crate::NamedVector;
pub use crate::OwnedProtect;
pub use crate::ProtectScope;
pub use crate::Protected;
pub use crate::ProtectedStrVec;
pub use crate::RCow;
pub use crate::StrVec;
pub use crate::StrVecBuilder;
pub use crate::BuiltDataFrame;
pub use crate::ColumnarFrame;
pub use crate::DataFrame;
pub use crate::DataFrameError;
pub use crate::FromDataFrame;
pub use crate::IntoDataFrame;
pub use crate::IntoDataFrameSplit;
pub use crate::AsDataFrameExt;
pub use crate::AsExternalPtrExt;
pub use crate::AsListExt;
pub use crate::AsNamedListExt;
pub use crate::AsNamedVectorExt;
pub use crate::AsRNativeExt;
pub use crate::Sendable;
pub use crate::with_r_thread;
pub use crate::r_print;
pub use crate::r_println;
pub use crate::r_warning;
pub use crate::expression::r_eval_str;
pub use crate::r_str;
pub use crate::SEXP;
pub use crate::SexpExt;

Macros§

list
Construct an R list from Rust values.
r
Evaluate R code written as Rust tokens, validated at compile time.
typed_dataframe
Define a compile-time-validated wrapper for an R data.frame input.
typed_list
Create a TypedListSpec for validating ... arguments or lists.

Attribute Macros§

miniextendr
Export Rust items to R.

Derive Macros§

Altrep
Derive ALTREP registration for a data struct.
AltrepComplex
Derive macro for ALTREP complex vector data types.
AltrepInteger
Derive macro for ALTREP integer vector data types.
AltrepList
Derive macro for ALTREP list vector data types.
AltrepLogical
Derive macro for ALTREP logical vector data types.
AltrepRaw
Derive macro for ALTREP raw vector data types.
AltrepReal
Derive macro for ALTREP real vector data types.
AltrepString
Derive macro for ALTREP string vector data types.
DataFrameRow
Derive DataFrameRow: generates a companion *DataFrame type with collection fields, plus IntoR / TryFromSexp / IntoDataFrame impls for seamless R data.frame conversion.
ExternalPtr
Derive macro for implementing TypedExternal on a type.
IntoList
Derive IntoList for a struct (Rust → R list).
IntoR
Derive IntoR for a single-field newtype: forward the Rust → R conversion to the inner type.
MatchArg
Derive MatchArg: enables conversion between Rust enums and R character strings with match.arg semantics (partial matching, informative errors).
RFactor
Derive RFactor: enables conversion between Rust enums and R factors.
TryFromSexp
Derive TryFromSexp for a single-field newtype: forward the R → Rust conversion to the inner type.