I'm writing a software with Rust due to speed and safety advantage compared to alternatives. One of the main feature of the software is to have plugins support, so someone could write a rust code and the software would use that code (lib) located under for example plugins directory.
I guess the way is to use library files, for example .dll on Windows and .so on Linux.
Do you a recommendation how should I structure the project and how approach this goal?
One option to consider is having the plugins be WebAssembly (.wasm) rather than native shared libraries (.dll or .so):
Multiple languages can be compiled to WASM, and it should offer security and portability benefits (it's more sandboxed and cross-platform), although it may not be quite mature yet (others could comment more knowledgeably on whether it is).
I understand that the main WASM engines for Rust are Wasmer and Wasmtime: