Skip to main content

Module dylib

Module dylib 

Source
Expand description

Compiled vector environments in shared libraries, behind a C ABI.

A crate of environments compiled ahead of time (with ruxla-build) can be built as a cdylib that exports them with export_vec_envs!; a program built separately (with another compiler or other versions of the ruxla crates, such as the Python extension) then loads the library with Library::open and steps its environments through LibVecEnv. Only the table of extern "C" functions of VTable crosses the boundary, checked by ABI_VERSION.

ⓘ
// lib.rs of a crate with `crate-type = ["cdylib"]` and a build script that
// calls `ruxla_build::Builder::new(dir).compile()`:
ruxla_env::include_envs!();
ruxla_env::export_vec_envs!();

Structs§

LibVecEnv
Vector environments of a Library, with the operations of CompiledVecEnv.
Library
A loaded library of compiled vector environments.
Make
The visitor of export_vec_envs!: makes the vector environment of a compiled environment.
VTable
The functions of a library of compiled vector environments. The environments are opaque pointers made by create and freed by destroy; strings are UTF-8 bytes with their length.

Enums§

DylibError
An error of Library::open or Library::create.

Constants§

ABI_VERSION
The version of VTable; a library with another version is rejected.
VTABLE_SYMBOL
The name of the function that a library exports: it returns the library’s VTable.

Traits§

DynVecEnv
A compiled vector environment behind a trait object, as the library side keeps it.

Functions§

vtable
The table of a library with modules, made by make (called by export_vec_envs!).