.. _example-rust-app: Example Rust app ================ This how-to guide covers the steps, decisions, and implementation details that are unique when crafting a Rust-based snap. We'll work through the aspects unique to Rust apps by examining an existing project. The process of developing a snap for a Rust app builds on top of standard Rust packaging tools and configuration, making it possible to adapt or integrate an app's existing build tooling into the crafting process. Example project file for XSV ---------------------------- The following code comprises the project file of a Rust app, `XSV `_. It analyses and manipulates CSV files. .. collapse:: XSV project file .. literalinclude:: ../code/craft-a-snap/example-rust-recipe.yaml :caption: snapcraft.yaml :language: yaml :lines: 2- Add a part written in Rust -------------------------- .. literalinclude:: ../code/craft-a-snap/example-rust-recipe.yaml :caption: snapcraft.yaml :language: yaml :start-at: parts: :end-at: source: . Rust parts are built with the `Rust plugin `_. This project file bundles the current stable release of Rust in the snap using Rustup. Dependencies from the project's ``Cargo.toml`` are also bundled. To declare a Rust part: #. Declare the general part keys, such as ``source``, ``override-build``, ``build-packages``, and so on. #. Set ``plugin: python``. #. If the snap uses core18, you can override the Rust toolchain version with the ``rust-revision`` list key.