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§
- LibVec
Env - Vector environments of a
Library, with the operations ofCompiledVecEnv. - 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
createand freed bydestroy; strings are UTF-8 bytes with their length.
Enums§
- Dylib
Error - An error of
Library::openorLibrary::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§
- DynVec
Env - A compiled vector environment behind a trait object, as the library side keeps it.
Functions§
- vtable
- The table of a library with
modules, made bymake(called byexport_vec_envs!).