← All Workshops
MudEngine Part 3: File-Based World Loading
Step 3 / 8
Add dependencies
Rust does not include TOML parsing in the standard library. We need two crates:
serde— a framework for serializing and deserializing Rust data structurestoml— a TOML parser that works with serde
Add them to Cargo.toml in the mud-engine-repl project.
mud-engine-repl/Cargo.toml
[package] name = "mud-engine-repl" version = "0.1.0" edition = "2021" [dependencies] serde = { version = "1", features = ["derive"] } toml = "0.8"
💡 serde derives
The features = ["derive"] flag enables the #[derive(Deserialize)] macro. Without it you would have to implement the deserialization trait manually.
toml = "0.8" is the latest major version as of 2025. It works with both serde's Deserialize and Serialize traits.
Step 3 / 8