# Generating Your First Rust App with Cargo

DevFeed: [Generating Your First Rust App with Cargo](<https://devfeed.tech/articles/generating-your-first-rust-app-with-cargo-28318.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/rust/2020/02/23/generating-your-first-rust-app-with-cargo.html>)

Author: Fuzzygroup

Published: 2020-02-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [create](<https://devfeed.tech/tags/create.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [docs](<https://devfeed.tech/tags/docs.md>), [packages](<https://devfeed.tech/tags/packages.md>), [project](<https://devfeed.tech/tags/project.md>), [rust](<https://devfeed.tech/tags/rust.md>), [tool](<https://devfeed.tech/tags/tool.md>)

## AI overview

This tutorial introduces Cargo as the tool for creating a Rust application. It demonstrates generating a project with cargo new, describes the Cargo.toml package manifest and dependencies, and shows the initial src/main.rs Hello World program.

## Source excerpt

The Rust tool cargo is the Rust equivalent of rake and bundler and rails combined (these are Ruby tools). Cargo is what you use to generate a new Rust app. Here's an example: cargo new loader_datastreamer_to_kafka_rust This generates a new, correctly laid out project directory. And here's what it looks like: ❯ tree . ├── Cargo.toml └── src └── main.rs 1 directory, 2 files The Cargo.toml file is a package manifest which has a default contents of this: ❯ cat Cargo.toml [package] name = "loader_datastreamer_to_kafka_rust1" version = "0.1.0" authors = ["Scott Johnson <blahblah@gmail.com>"] edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] Any Rust packages, which are named crates, you use in your application would be listed under the dependencies section. Here's an example of that: [dependencies] notify = "4.0.15" That's an example of using the notify crate. Your default main.rs file is always stored in src and looks like this initially: ❯ cat src/main.rs fn main() { println!("Hello, world!"); } Yep - you get a Hello World for free when you create any Rust application. Cargo actually does quite a bit more than just creating your Rust application but that's a topic for another day.