Features - The Cargo Book
Cargo “features” provide a mechanism to express conditional compilation and optional dependencies. A package defines a set of named features in the [features] table of Cargo.toml, and each feature can either be enabled or disabled. Features for the package being built can be enabled on the command-line with flags such as --features. Features for dependencies can be enabled in the dependency declaration in Cargo.toml. Note: New crates or versions published on crates.io are now limited to a maximum of 300 features. Exceptions are granted on a case-by-case basis. See this blog post for details. Participation in solution discussions is encouraged via the crates.io Zulip stream. See also the Features Examples chapter for some examples of how features can be used. Features are defined in the [features] table in Cargo.toml. Each feature specifies an array of other features or optional dependencies that it enables. The following examples illustrate how features could be used for a 2D image pro
Features - The Cargo Book Keyboard shortcuts Press ← or → to navigate between chapters Press S or / to search in the book Press ? to show this help Press Esc to hide this help Auto Light Rust Coal Navy Ayu The Cargo Book Features Cargo “features” provide a mechanism to express conditional compilation and optional dependencies . A package defines a set of named features in the [features] table of Cargo.toml , and each feature can either be enabled or disabled. Features for the package being built can be enabled on the command-line with flags such as --features . Features for dependencies can be
Explore this link on the map →related reading
- Hello, Cargo! - The Rust Programming Languagedoc.rust-lang.org
- Overriding Dependencies - The Cargo Bookdoc.rust-lang.org
- A Guide to Claude Code 2.0 and getting better at using coding agents – sankalp's blogsankalp.bearblog.dev
- The Rust Programming Language - The Rust Programming Languagedoc.rust-lang.org
- A half-hour to learn Rustfasterthanli.me
- Flagsvercel.com
- Rewriting Bun in Rust | Bun Blogbun.com
- Rust Language Cheat Sheetcheats.rs
- Yagnimartinfowler.com
- Could we have Rust without provenance? · Issue #287 · rust-lang/unsafe-code-guidelines · GitHubgithub.com
- Rust Documentationdoc.rust-lang.org
- Patterns for Defensive Programming in Rust | corrode Rust Consultingcorrode.dev