Skip to content

crwn1337/rust-plugin-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-plugin-system

a simple example for creating a plugin system in Rust without dependencies (except for libloading for obvious reasons)

the main application (where the plugins get loaded)

definitions to be used for plugins and the application

an example plugin

pros

  • basically 0 overhead (since its pure rust)
  • structure states, so no global variables
  • you get to use the entire rust standard library
  • you get to use any external crates rust provides
  • the rust compiler should help with any errors at compile time

cons

  • not ffi safe, you should use abi_stable, but i don't like dragging in 50~70 dependencies
  • no intellisense (rust-analyzer doesn't like working with the include! macro)
  • there might be lifetime issues with 'static, but it only seems to be an issue if you manually drop the library
  • there might be issues with very very old versions of macos and linux
  • compiling the application and plugin with different versions of the rust compiler MIGHT introduce issues (not ffi safe, yet again)

About

trying to make a "simple" plugin system in rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages