Crates.io | javy-plugin-api |
lib.rs | javy-plugin-api |
version | 2.0.0 |
source | src |
created_at | 2024-11-12 22:24:52.323831 |
updated_at | 2024-11-27 16:05:43.469654 |
description | APIs for Javy plugins |
homepage | https://github.com/bytecodealliance/javy/tree/main/crates/javy-plugin-api |
repository | https://github.com/bytecodealliance/javy/tree/main/crates/javy-plugin-api |
max_upload_size | |
id | 1445657 |
size | 12,292 |
Refer to the crate level documentation to learn more.
Example usage:
use javy_plugin_api::import_namespace;
use javy_plugin_api::Config;
// Dynamically linked modules will use `my_javy_plugin_v1` as the import
// namespace.
import_namespace!("my_javy_plugin_v1");
#[export_name = "initialize_runtime"]
pub extern "C" fn initialize_runtime() {
let mut config = Config::default();
config
.text_encoding(true)
.javy_stream_io(true);
javy_plugin_api::initialize_runtime(config, |runtime| runtime).unwrap();
}
To publish this crate to crates.io, run ./publish.sh
.