Last active
March 13, 2020 14:51
-
-
Save Wazzaps/3c10a6cf03dfd87d6d8c3a83eb0e0a5d to your computer and use it in GitHub Desktop.
Rust plugins request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use main_app::my_mod::my_callable; | |
pub extern fn plugin_main() { | |
my_callable(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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