Types and a macro for easy creation of X-Plane plugins in Rust
APACHE-2.0 License
This library provides a macro for easy creation of plugins for X-Plane.
With this library and the xplm crate, X-Plane plugins can be easily developed in Rust.
To import the macro, the crate must be imported like this:
#[macro_use]
extern crate xplane_plugin;
Creating a plugin involves three steps:
Plugin
for your plugin structxplane_plugin!(YourPluginStruct)
in a file, not in any function#[macro_use]
extern crate xplane_plugin;
use xplane_plugin::*;
struct TestPlugin;
impl Plugin for TestPlugin {
fn start() -> Option<Self> {
Some(TestPlugin)
}
fn enable(&mut self) {
}
fn disable(&mut self) {
}
fn stop(&mut self) {
}
fn info<'a, 'b, 'c>(&self) -> PluginInfo<'a, 'b, 'c> {
PluginInfo {
name: "Test Plugin",
signature: "org.samcrow.rustplugin.test",
description: "A plugin written in Rust",
}
}
}
xplane_plugin!(TestPlugin);
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.