|0.1.7||Jun 9, 2019|
|0.1.6||Dec 28, 2018|
|0.1.5||Jul 17, 2018|
|0.1.4||May 9, 2018|
|0.1.2||Sep 6, 2017|
#17 in Operating systems
850 downloads per month
Used in 1 crate
This library is my effort to make use of dynamic link libraries in Rust simple. Previously existing solutions were either unsafe, provided huge overhead of required writing too much code to achieve simple things. I hope that this library will help you to quickly get what you need and avoid errors.
- Supports majority of platforms and is platform independent.
- Is consistent with Rust error handling mechanism and makes making mistakes much more difficult.
- Is very lightweight. It mostly uses zero cost wrappers to create safer abstractions over platform API.
- Is thread safe.
- Is object-oriented programming friendly.
- Has a low-level API that provides full flexibility of using libraries.
- Has two high-level APIs that protect against dangling symbols - each in its own way.
- High level APIs support automatic loading of symbols into structures. You only need to define a structure that represents an API. The rest happens automatically and requires only minimal amount of code.
- Automatic loading of symbols helps you to follow the DRY paradigm.
|Dangling symbol prevention||Yes||Yes||Yes|
|Thread safety||Yes||Potential problem with SetErrorMode() on older Windows platforms||No support for SetErrorMode (library may block the application on Windows)|
|Loading of symbols into structures||Yes||No||No|
|Low-level, unsafe API||Yes||Yes||Yes|
Please note that while Rust aims at being 100% safe language, it does not yet provide mechanisms that would allow me to create a 100% safe library, so I had to settle on 99%. Also the nature of dynamic link libraries requires casting obtained pointers into types that are defined on the application side. And this cannot be safe. Having said that I still think that this library provides the best approach and greatest safety possible in Rust.
[dependencies] dlopen = "0.1"
This code is licensed under MIT license.