pitwall-tauri
Tauri integration for Pitwall - stream iRacing telemetry to TypeScript frontends with compile-time type safety.
Features
- Type-Safe IPC: Automatic TypeScript type generation from Rust structs
- High Performance: <1% CPU overhead for 60Hz telemetry streaming
- Stateless Design: Pure stream mirroring with no state management
- Simple API: One function (
to_channel) handles all streaming
Installation
# src-tauri/Cargo.toml
[]
= { = "0.1", = ["derive"] }
= "0.1"
= "2"
= { = "2.0.0-rc", = ["typescript"] }
= { = "2.0.0-rc", = ["derive"] }
= { = "1", = ["derive"] }
= { = "1", = ["full"] }
Quick Start
1. Define Your Frame Type
use PitwallFrame;
use ;
use Type;
2. Create Tauri Command
use Channel;
use ;
pub async
3. Generate TypeScript Bindings
// src-tauri/src/main.rs
4. Use in TypeScript
import { invoke, Channel } from '@tauri-apps/api/core';
import type { MyTelemetry, SessionInfo } from './bindings';
const telemetryChannel = new Channel<MyTelemetry>();
telemetryChannel.onmessage = (data) => {
console.log(`Speed: ${data.speed}, RPM: ${data.rpm}`);
};
const sessionChannel = new Channel<SessionInfo>();
sessionChannel.onmessage = (info) => {
console.log(`Track: ${info.weekend_info.track_display_name}`);
};
await invoke('start_telemetry', {
telemetry: telemetryChannel,
session: sessionChannel,
});
License
Licensed under the MIT License.