Crates.io | libraildriver |
lib.rs | libraildriver |
version | 0.1.2 |
source | src |
created_at | 2019-09-27 19:55:23.591117 |
updated_at | 2022-04-23 21:10:14.896178 |
description | FFI bindings for TS2020's RailDriver.dll |
homepage | https://github.com/Bsalarius/libraildriver |
repository | https://github.com/Bsalarius/libraildriver |
max_upload_size | |
id | 168199 |
size | 15,187 |
Rust FFI bindings to the RailDriver.dll
library.
These allow you to read and write data to or from Train Simulator 2020. Note that this doesn't work with Train Sim World.
extern crate libraildriver;
fn main() {
let context = libraildriver::Context::new();
let speed = context.get_value(libraildriver::Value::Speedometer,
libraildriver::Kind::Current).expect("Failed to get value.");
println!("The train's current speed is: {}", speed);
}