v1.0.0
Last Updated: 01/05/24
Explore the projects in this repository to deepen your understanding of Rust:
- "README": Finish this doc to set up rust before moving on to the different projects listed below.
- "hello": An introduction to Rust. Compare the read-me file with the "hello" project you just created.
- "variables": Learn about variables with comprehensive explanations and code snippets.
- "functions": Delve into calculations, functions, and more.
- "module": Start exploring object-oriented programming concepts.
- In Progress... Stay tuned for more learning resources and projects.
Happy coding!
Welcome to Rust_Intro, your gateway to learning Rust! This guide will walk you through the process of installing Rust, setting up your initial projects, and provide step-by-step instructions for understanding the basics of Rust programming.
Start your Rust journey by installing Rust on your system. Visit Rust's official website and follow the installation instructions. The images below illustrate the installation process:
Once the installation is complete, you'll find a new terminal pop-up. If not, run the executable manually. The image below demonstrates this process:
Let's dive into creating your first Rust project. Open a new terminal, navigate to your desired working directory, and execute the following commands:
- Navigate back:
cd..
- Change to a specific path:
cd /c:/path
- List files and directories:
dir
- Change to a different drive:
E:
- Navigate back:
cd ..
- Change to a specific path:
cd /path
- List files and directories:
ls
Now, create a new project named "hello" by typing:
cargo new hello
Enter the project directory with:
cd hello
Run the project:
cargo run
Your terminal should display "Hello, world!" as the output:
Cargo:
Think of it as Rust's package manager, similar to Pip for Python or npm for JavaScript. But Cargo is more—it's also the build system, test runner, docs generator, and more. Check the version with:
cargo --version
Hello, world! Code:
You'll find the code responsible for printing "Hello, world!" inhello/src/main.rs
.
Let's now go to the hello
repo and continue with this first project.