Crates within rust-wiiu
The rust-wiiu
project is structured as a collection of interconnected crates (Rust's package management units). These crates serve various purposes:
- Fundamental Toolchain Crates: These provide the core building blocks for Wii U development, such as rust-wiiu/wut and rust-wiiu/wups.
- C Library Wrappers: These crates encapsulate and extend the functionality of existing C libraries, offering a safer and more idiomatic Rust interface. Examples include rust-wiiu/notifications and rust-wiiu/kernel.
- Pure Rust Crates: These are newly developed crates written entirely in Rust and do not rely on pre-existing C code.
From a developer's perspective, all these crates are used in the same way. However, understanding their underlying nature can be helpful when troubleshooting errors, particularly during the compilation phase.
Crates as Git Dependencies
All rust-wiiu
crates are distributed directly via their respective GitHub repositories rather than through registries like crates.io
. Fortunately, Cargo provides built-in support for specifying dependencies from git repositories.
As an example, to add the latest release of the wut
crate as a dependency to your Cargo.toml
file, you can use the following command:
cargo add --git https://github.com/rust-wiiu/wut.git wut