Rust Crab

Rust Documentation: Chapter 4 - References

In the previous chapter, we saw how ownership works in Rust. The main drawback we saw was that for functions, the return value changes ownership and the original variable is no longer usable. In this chapter, we will look at a continuation of ownership, i.e. references. References Instead of passing variables to functions, we can pass references to functions. reference is like a pointer we can follow to get to the data....

May 1, 2023 · 8 min · Tanmay
Rust Crab

Rust Documentation: Chapter 4 - Ownership

In the previous chapter, we saw how we can use data types, functions, and control flow in rust. In this chapter, we will look at the most unique feature of rust - ownership. Ownership Ownership enables Rust to make memory safety guarantees without needing a garbage collector, so it’s important to understand how ownership works. In this chapter, we’ll talk about ownership as well as several related features: borrowing, slices, and how Rust lays data out in memory....

April 29, 2023 · 8 min · Tanmay
Rust Crab

Rust Documentation: Chapter 3

In the previous chapter, we built a simple guessing game. Now, we will learn more about variables, data types, mutability, and control flow in Rust Variables and Mutability In Rust, we define variables with let keyword. However, variables by default are not mutable in Rust. This means that once a variable is defined, it cannot be changed. To make a variable mutable, we use the mut keyword after the let keyword....

April 26, 2023 · 9 min · Tanmay
Rust Crab

Rust Documentation: Chapter 2

Programming a Guessing Game 🎲 In the previous chapter, we learned about the basics of Rust. In this chapter, we will learn about the basics of Rust by building a simple guessing game. Setting up the project We will use the Cargo package manager to create a new project called guessing_game. We can create a new project using the following command: cargo new guessing_game This creates a new project called guessing_game in the current directory....

April 18, 2023 · 13 min · Tanmay
Rust Crab

Rust Documentation: Chapter 1

What is Rust? Rust is a programming language that is designed to be safe, fast, and concurrent. It is a systems programming language that is used to build low-level software. It is a statically typed language that is compiled to machine code. It is a language that is used to build operating systems, browsers, and other low-level software. This blog post summarizes the key takeaways about the origins of Rust and its usefulness in software development MIT Technology Review: How Rust went from a side project to the world’s most-loved programming language...

April 17, 2023 · 4 min · Tanmay