← All Workshops

MudEngine Part 3: File-Based World Loading

Add dependencies

Rust does not include TOML parsing in the standard library. We need two crates. serde is documented here, and the toml crate docs are here. If you want the file-format reference, the official TOML specification is the canonical source:

  • serde — a framework for serializing and deserializing Rust data structures
  • toml — 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 = "2024"

[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.