Add common struct
This commit is contained in:
parent
cdb82d6ccc
commit
4b94fa645c
10 changed files with 65 additions and 25 deletions
7
plugins/hotload_toto1/Cargo.lock
generated
7
plugins/hotload_toto1/Cargo.lock
generated
|
@ -2,6 +2,13 @@
|
|||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "hotload_plugin"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "hotload_toto1"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hotload_plugin",
|
||||
]
|
||||
|
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
# hotload_plugin = { path = "../../crates/hotload_plugin" }
|
||||
hotload_plugin = { path = "../../crates/hotload_plugin" }
|
||||
|
||||
[lib]
|
||||
crate-type = ["dylib"]
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
#[no_mangle]
|
||||
pub extern fn version() -> String {
|
||||
"0.2.0".to_string()
|
||||
}
|
||||
use hotload_plugin::HotloadPlugin;
|
||||
|
||||
#[no_mangle]
|
||||
pub extern fn name() -> String {
|
||||
"test name".to_string()
|
||||
pub extern "C" fn register() -> *const HotloadPlugin {
|
||||
let plugin = Box::new(HotloadPlugin {
|
||||
name: String::from("test_lib"),
|
||||
version: String::from("0.1.0"),
|
||||
author: String::from("mrdev023"),
|
||||
});
|
||||
|
||||
Box::into_raw(plugin)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue