xplane_plugin 0.1.1

Provides types and a macro for creating X-Plane plugins
Documentation
  • Coverage
  • 91.67%
    11 out of 12 items documented0 out of 7 items with examples
  • Size
  • Source code size: 20.64 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.43 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • samcrow/rust-x-plane-plugin
    7 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • samcrow

X-Plane plugin macro for Rust

Purpose

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.

Use

To import the macro, the crate must be imported like this:

#[macro_use]
extern crate xplane_plugin;

Creating a plugin involves three steps:

  1. Create a struct for your plugin
  2. Implement Plugin for your plugin struct
  3. Place xplane_plugin!(YourPluginStruct) in a file, not in any function

Examples

#[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);

License

Licensed under either of

at your option.

Contribution

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.