> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hop.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Rust

> Deploy Rust applications with Hop

<Snippet file="nixpacks-notice.mdx" />

Rust is detected if a `Cargo.toml` file is found in your project root. Hop builds your project using `cargo build --release` and then deploys and executes the resulting binary.

## Versions

Hop supports all Rust versions. By default, the latest version is used, however it can be overriden by either:

* The `rust-version` property in `Cargo.toml`,
* Setting the `NIXPACKS_RUST_VERSION` environment variable, or
* A `rust-toolchain.toml` file

## Workspaces

Hop will automatically detect if you are using [Cargo Workspaces](https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html).

This checks `workspace.default_members` first and then `workspace.members`. It also respects the `workspace.exclude` field.

To set which workspace Hop will build, just set the `NIXPACKS_CARGO_WORKSPACE` environment variable and Hop will use it as the `--package` argument.
