Module abi_stable::library

source ·
Expand description

Traits and types related to loading an abi_stable dynamic library, as well as functions/modules within.

Loading the root module

When you use the RootModule::load_from* associated functions, the root module of a library is loaded in this order:

  1. A RawLibrary is loaded (The library is leaked so that the root module loader can do anything incompatible with library unloading.)
  2. An AbiHeaderRef handle to the static that contains the root module is obtained.
  3. The AbiHeaderRef checks that the abi_stable version used by that library is compatible with the loader’s, upgrading to a &'static LibHeader on success.
  4. The LibHeader checks that the layout of the types in the root module (and everything it references) are compatible with the loader’s
  5. The root module is loaded using the function from the loaded library that was annotated with #[export_root_module].
  6. RootModule::initialize is called on the root module.

All steps can return errors.

Re-exports

Modules

  • This module runs tests on the C abi as defined by Rust, to detect whether Rust changed how it deals with zero-sized types.
  • Utilities for use while developing dynamic libraries.

Structs

Enums

Constants

Traits

  • For converting the return value of a #[export_root_module] function to a Result<_, RootModuleError>.
  • The root module of a dynamic library, which may contain other modules,function pointers,and static references.

Functions

Type Aliases