Loading tutorials
cargo build. Later chapters build on these terms: modules, visibility, dependencies, workspaces, and tests.5 min readResult), have a working grasp of ownership and borrowing, and can run cargo build and `cargo5 min readResult code, and that you know what mod and pub do from the earlier chapters on modules and the module tree. Here you will learn how the compiler resolves a name to an item and how use shortens those names.5 min readpub, how privacy works for fields and variants, an5 min readmod, use pub for visibility, and run cargo build. It covers how Rust maps the module tree onto files and directories, the two layouts you can choose from, and the errors people hit most often.5 min readuse declarations, and pub visibility work. It covers pub use, which lets you separate where code lives from the path users type to reach it.5 min readcargo build and cargo run, and know that a module tree starts at a crate root. It covers how one Cargo package can hold a library crate and one or more binary crates, and why that layout is the usual way to make a program testable.4 min readcargo build and cargo run, and that you know what a package and a crate are from the earlier chapters. It covers how a package declares the external crates it uses, how Cargo resolves versions, and the errors you are most likely to meet.5 min readCargo.toml, know the difference between a package and a crate, and have used cargo build and cargo run. You should also understand how dependencies are declared. Here you will learn how Cargo features let one package build in several configurations, and how 5 min readCargo.toml, know the difference between a package and a crate, and have used path dependencies and cargo test at a basic level. It builds on the earlier chapters about library and binary crates and about dependencies.5 min readCargo.toml, add a normal dependency, and write a basic #[test] function. It also assumes you know the layout of a package: src/, tests/, and the idea that a package can contain a library crate and binaries. Here you learn how to declare crates that only yo5 min readResult handling, and that you can run cargo build. You should also know how modules nest and how use and pub work, covered in earlier chapters.5 min read#[test] function inside a #[cfg(test)] module and run cargo test, as covered in the previous chapter on unit tests. It also assumes you know Result, the ? operator, and the Debug and PartialEq traits at an introductory level.5 min read#[cfg(test)], you know how pub controls visibility, and you have a package with a src/lib.rs. Unit tests check internals from inside the crate. Integration tests check the crate the way a user sees it, from the outside.5 min readpub and use paths work, and you can run cargo test. It covers how Rust turns the code examples in your documentation into tests, how to hide or annotate parts of an example, and what usually goes wrong.5 min read#[test] functions, know the difference between unit, integration, and doc tests, and can read a Cargo.toml. It covers how cargo test chooses what to run, how to narrow that selection, and how to change how the tests execute.5 min read