scs-sdk-telemetry 1.2.0

Rust wrapper for the ETS2 (Euro Truck Simulator 2) and ATS (American Truck Simulator) Telemetry SDK plug-in.
#[cfg(feature = "json")]
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Default)]
#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "json", serde(rename_all(serialize = "snake_case")))]
pub struct Control {
  pub raw_input: RawInput,
  pub game_input: GameInput
}

#[derive(Debug, Clone, Default)]
#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "json", serde(rename_all(serialize = "snake_case")))]
pub struct RawInput {
  pub steering: f32,
  pub throttle: f32,
  pub brake: f32,
  pub clutch: f32
}

#[derive(Debug, Clone, Default)]
#[cfg_attr(feature = "json", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "json", serde(rename_all(serialize = "snake_case")))]
pub struct GameInput {
  pub steering: f32,
  pub throttle: f32,
  pub brake: f32,
  pub clutch: f32
}