| Crates.io | insim |
| lib.rs | insim |
| version | 4.0.0 |
| created_at | 2024-02-06 18:04:41.577665+00 |
| updated_at | 2025-08-16 20:54:22.083935+00 |
| description | LiveForSpeed Insim implementation that focuses on ergonomics and strong typing |
| homepage | https://github.com/theangryangel/insim.rs |
| repository | |
| max_upload_size | |
| id | 1129262 |
| size | 333,421 |
A friendly, Rust idiomatic library for the InSim protocol used by Live for Speed racing simulator.
The focus of this library is providing a high level, strongly typed, primitives that are difficult to misuse and have reasonable performance, rather than be a thin layer over a series of bytes.
Where possible this crate aligns the naming of fields in packets to match the original Insim specification.
In a handful of circumstances we have needed to rename, or separate some fields to align with the crate's key focus.
Here is a non-exhaustive list of the things that insim supports:
insim is on crates.io and can be used by adding insim to your dependencies in your project’s Cargo.toml.
Or more simply, just run cargo add insim.
If you want to use an unreleased version you can also reference the GitHub repository.
You might also find these related crates useful:
insim_pth – for reading and writing LFS PTH filesinsim_smx – for reading and writing LFS SMX filesoutgauge - "sans-io" implementation of the LFS outgauge protocoloutsim - "sans-io" implementation of the LFS outsim protocolThey follow the same design focus and can be found in the same GitHub repository.
Looking for more examples? Take a look at our more detailed examples here: https://github.com/theangryangel/insim.rs/tree/main/examples – it's full of practical code to help you get started.
let conn = insim::tcp("127.0.0.1:29999").connect_async().await?;
loop {
let packet = conn.read().await?;
println!("{:?}", packet);
match packet {
insim::Packet::Mci(_) => {
println!("Got a MCI packet!")
},
_ => {},
}
}
let conn = insim::tcp("127.0.0.1:29999").connect()?;
loop {
let packet = conn.read()?;
println!("{:?}", packet);
match packet {
insim::Packet::Mci(_) => {
println!("Got a MCI packet!")
},
_ => {},
}
}
let conn = insim::tcp("127.0.0.1:29999", None).connect_async().await?;
loop {
let packet = conn.read().await?;
println!("{:?}", packet);
match packet {
insim::Packet::Mci(_) => {
println!("Got a MCI packet!")
},
_ => {},
}
}
| Name | Description | Default? |
|---|---|---|
serde |
Enable serde support | No |
tokio |
Enable tokio support | Yes |
blocking |
Enable blocking/sync support | Yes |