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

1 directory, 2 files

The Cargo.toml file is a package manifest which has a default contents of this:

❯ cat Cargo.toml
name = "loader_datastreamer_to_kafka_rust1"
version = "0.1.0"
authors = ["Scott Johnson <>"]
edition = "2018"

# See more keys and their definitions at


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:

notify = "4.0.15"

That's an example of using the notify crate.

Your default file is always stored in src and looks like this initially:

❯ cat src/
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.