Does Rust have a dlopen equivalent

后端 未结 3 977
梦如初夏
梦如初夏 2020-12-08 07:14

Does Rust have a way to make a program pluggable. In C the plugins I create are .so files that I load with dlopen. Does Rust provide a native way of doing the same thing?

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 08:00

    Yes. There's a module std::unstable::dynamic_lib that enables dynamic loading of libraries. It's undocumented, though, as it's a highly experimental API (everything in std::unstable is undocumented). As @dbaupp suggests, the source is the best documentation (current version is af9368452).

提交回复
热议问题