Crate stellwerksim

Source
Expand description

§stellwerksim-rs

Rust SDK for writing asynchronous StellwerkSim plugins using tokio.

§Implemented Request Types

Note: All request types except events are implemented. Feel free to contribute.

§Example

Create plugin instance via the Plugin::builder. It will connect to StellwerkSim and register the plugin automatically.

use stellwerksim::{Error, Plugin};

#[tokio::main]
async fn main() -> Result<(), Error> {
    let plugin = Plugin::builder()
        .name("My stellwerksim-rs Plugin")
        .author("Me")
        .version(env!("CARGO_PKG_VERSION")) // Embed version from Cargo.toml
        .description("My plugin built with stellwerksim-rs")
        .connect().await?;
    Ok(())
}

Modules§

protocol
StellwerkSim’s xml based protocol.

Structs§

Plugin
A running StellwerkSim Plugin instance.
PluginBuilder
Builder for constructing a Plugin.

Enums§

Error
The errors which may occur when using a Plugin.