Skip to content

Instantly share code, notes, and snippets.

@Wazzaps
Last active March 13, 2020 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wazzaps/3c10a6cf03dfd87d6d8c3a83eb0e0a5d to your computer and use it in GitHub Desktop.
Save Wazzaps/3c10a6cf03dfd87d6d8c3a83eb0e0a5d to your computer and use it in GitHub Desktop.
Rust plugins request
use main_app::my_mod::my_callable;
pub extern fn plugin_main() {
my_callable();
}
mod my_mod {
pub extern fn my_callable() {
println!("hello");
}
}
fn main() {
let my_plugin_main: Fn() = load_library_somehow("example_plugin").get_symbol("plugin_main") as Fn();
my_plugin_main();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment