The easiest, simplest and safest way to load dynamic (shared object) libraries from Rust!
Features
- Macro to create a structure that dynamically loads a C API
- Works on Unix and Windows
Roadmap to 1.0 (Future Features)
- Make it easier to load parts of API at any time (modular loading from same .so file).
- Support some other obscure OS's.
- Different loading macro for Rust ABI / other ABIS (possible ABI parameter to the macro?)
- Make sure it's perfect.
Getting Started: Example
The code inside of the curly braces for link!()
matches exactly with code inside of the curly
braces for extern "C"
. This makes it easy for you to turn your extern "C"
s into link!()
s.
// Shared object: either "libmylibrary.so.1", "mylibrary-1.dll" or "libMyLibrary.dylib"
link!;