Rust and dynamic loading of code


Hi there Rusteceans! I’m wondering is it possible for rust to support dynamic load of crates/modules/traits? Basically what I’m looking for Rust’s analogue of JDBC, where you can say ok implement this interface and I’ll load you during runtime.


It’s possible but not supported. The compiler itself has plugins. The plugin loading is done here:

It uses the dynamic_lib crate:

Be aware that this is highly unstable code and may change and break your code at any time.