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.
register
- Automatically done by Plugin’s API.simzeit
- See Plugin::simulator_time. Requires thesimulator-time
feature flag which is Enabled by default!bahnsteigliste
- See Plugin::platform_list.zugliste
- See Plugin::train_list.zugdetails
- See Plugin::train_details.zugfahrplan
- See Plugin::train_timetable. Requires thetimetable
feature flag which is Enabled by default!wege
- See Plugin::ways.
§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.
- Plugin
Builder - Builder for constructing a Plugin.