# ryanstew/simconnect-rust architecture

> Architecture diagram of the GitHub repository ryanstew/simconnect-rust, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ryanstew/simconnect-rust
- Repository: https://github.com/ryanstew/simconnect-rust

## Overview

SimConnect is a small Rust binding library for communicating with the Microsoft Flight Simulator SimConnect API. The principal workflow is for a client to configure a connection and data request, then poll and interpret typed responses. The wrapper also exposes broader simulator controls and services, including events, client data, AI, weather, and facilities. The sampled source supports the connection, request, and dispatch flow; other capabilities are documented by exposed API names, but their detailed implementation is not shown.

Main entry points: [`src/lib.rs`](https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs) (Connection wrapper), [`libsrc/include/SimConnect.hpp`](https://github.com/ryanstew/simconnect-rust/blob/master/libsrc/include/SimConnect.hpp) (API declarations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rust["Rust bindings"]
  node_connector["Connection wrapper<br/>[lib.rs]"]
  node_data_requests["Data requests<br/>[lib.rs]"]
  node_dispatch["Response dispatch<br/>[lib.rs]"]
  node_events["Events and input<br/>[lib.rs]"]
  node_client_facilities["Client and facilities data<br/>[lib.rs]"]
  node_extended_services["Extended services<br/>[lib.rs]"]
end

subgraph group_simulator["Simulator API"]
  node_sim_api["API declarations<br/>[SimConnect.hpp]"]
end

node_client(("Client application"))
node_simulator_runtime["SimConnect runtime"]

node_client -->|"opens connection"| node_connector
node_client -->|"configures requests"| node_data_requests
node_client -->|"polls responses"| node_dispatch
node_connector -->|"opens session"| node_simulator_runtime
node_data_requests -->|"requests data"| node_simulator_runtime
node_dispatch -->|"reads dispatch"| node_simulator_runtime
node_events -->|"issues event calls"| node_simulator_runtime
node_client_facilities -->|"requests services"| node_simulator_runtime
node_extended_services -->|"invokes services"| node_simulator_runtime
node_sim_api -.->|"declares API"| node_simulator_runtime

click node_connector "https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs"
click node_data_requests "https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs"
click node_dispatch "https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs"
click node_sim_api "https://github.com/ryanstew/simconnect-rust/blob/master/libsrc/include/SimConnect.hpp"
click node_events "https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs"
click node_client_facilities "https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs"
click node_extended_services "https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_connector,node_data_requests,node_dispatch,node_events,node_client_facilities,node_extended_services,node_client toneBlue
class node_sim_api toneAmber
class node_simulator_runtime toneIndigo
```

## Components

### Rust bindings

- [Connection wrapper](https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs): `src/lib.rs`
- [Data requests](https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs): `src/lib.rs`
- [Response dispatch](https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs): `src/lib.rs`
- [Events and input](https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs): `src/lib.rs`
- [Client and facilities data](https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs): `src/lib.rs`
- [Extended services](https://github.com/ryanstew/simconnect-rust/blob/master/src/lib.rs): `src/lib.rs`

### Simulator API

- [API declarations](https://github.com/ryanstew/simconnect-rust/blob/master/libsrc/include/SimConnect.hpp): `libsrc/include/SimConnect.hpp`

### Other components

- **Client application**
- **SimConnect runtime**

## Connections

- Client application → Connection wrapper: opens connection (evidence: `Readme.md`)
- Client application → Data requests: configures requests (evidence: `Readme.md`)
- Client application → Response dispatch: polls responses (evidence: `Readme.md`)
- Connection wrapper → SimConnect runtime: opens session (evidence: `src/lib.rs`)
- Data requests → SimConnect runtime: requests data (evidence: `src/lib.rs`)
- Response dispatch → SimConnect runtime: reads dispatch (evidence: `src/lib.rs`)
- Events and input → SimConnect runtime: issues event calls (evidence: `src/lib.rs`)
- Client and facilities data → SimConnect runtime: requests services (evidence: `src/lib.rs`)
- Extended services → SimConnect runtime: invokes services (evidence: `src/lib.rs`)
- API declarations → SimConnect runtime: declares API
