
Explore Rust, a systems programming language that matches C and C++ performance with memory safety and concurrency, without a garbage collector, via ownership, move, and borrowing.
Explore Rust as a memory-safe systems language, focusing on ownership, memory safety guarantees, type inference, and pattern matching, with notes on efficient bindings and safe memory allocation.
Master mutable and immutable variables with let and let mut, and constants; explore shadowing, integer overflow and wrapping, and printing with the println! macro in Rust.
Understand Rust's println! macro, an extended version of functions, which prints formatted output using braces placeholders, while learning let-based type inference for floating point and integer types.
Explore Rust data types, including char, and learn why automatic type casting is disallowed; understand type inference, mutability, and basic project setup in Rust.
Discover Rust’s mutability rules using let and mut, explore constant naming conventions in uppercase, compare constants and variables, and learn shadowing and basic cargo workflow.
Explore strings in Rust, distinguishing string literals and string objects created with new or from. Learn lifetimes, ampersand usage for literals, and core string operations like push and replace.
Learn string concatenation in Rust using the + operator and internal add() function, and explore building strings with the format macro and practical formatting examples.
Explore decision making in Rust through if statements, if-else chains, nested blocks, and match statements, with practical examples of conditions, branches, and control flow.
Explore Rust's match statement, pattern matching, and exhaustive arms, with literals and wildcards, and see how it parallels C's switch in this complete Rust reference course.
General Introduction . Rust is for Systems programming. Systems programming is used Operating Systems, Networking, File systems, Databases , Cryptography and much more. Rust is very popular with Concurrency, memory safety at compile time, and multithreaded applications and type safety. Variables and mutability. By default variables are immutable in Rust. There is a concept called shadowing in Rust. We use println!() macro for printing. Macros are an extended version of functions. Data types. Automatic type casting is not allowed in Rust. Number separator for large numbers using underscores possible in Rust. The mut keyword is used for mutability. Rust strings are divided into string literals and string objects. Match statement is used in Rust like the switch case statement in C/C++. For returning values from functions we can use a single arrow --> like this to indicate a return type.
Parameters are passed to functions by value as well as by Reference as in other languages. There is a concept called Rust Ownership. The move operation in Rust is similar to a shallow copy in other languages. We have the stack memory as well as the Heap memory. Rust trait is very much similar to the concept of interfaces in Object oriented programming languages. There is a concept called copy trait in Rust.
Rust References and Borrowing. Observe Rust does not have the idea of Garbage collection. There is nothing like Exception handling also in Rust. Rust slices. A slice is a pointer to a block of memory. String slices are literals. Rust structure is similar to structures in other languages. Rust has Enums as well as Modules. Rust collections include Vector, Hash Map and Hash Set. Rust Error handling . Recoverable and Unrecoverable errors in Rust. Panic macro and Unrecoverable errors. Generic types, Generic structures.