Welcome to our comprehensive series on learning Rust, a powerful and efficient programming language. This playlist is designed to guide you from the very basics of Rust to its most advanced features. Whether you're entirely new to programming or an experienced developer looking to add Rust to your skillset, these lessons are structured to provide a clear and progressive learning path. Join us as we explore Rust's unique approach to safety, speed, and concurrency and become proficient in this increasingly popular language. Remember to subscribe and activate notifications so you don't miss the new videos
Curated by: Francesco Ciulla (54 videos)
Full Rust course: https://www.youtube.com/watch?v=R33h77nrMqc&list=PLPoSdR46FgI412aItyJhj2bF66cudB6Qs&index=1&t=4s Fullstack Rust Web Application: https://youtu.be/FYVbt6YFMsM?si=7X5l0KCD39WIsICv Important links: Rust book: https://mybook.to/YJI6DI Rust Workbook: https://francescociulla.gumroad.com/l/rustworkbook Rust Cheatsheet: https://francescociulla.gumroad.com/l/rustcheatsheet In this video, we dive into Closures in Rust, exploring their syntax, key features, and how they capture variables from their environment. We'll cover how closures borrow variables immutably, mutably, or take ownership, as well as a recap of closure traits like Fn, FnMut, and FnOnce. By the end, you'll understand the differences between functions and closures and how to use closures as function parameters. Closures in Rust: Anonymous Functions that Capture Their Environment 0:00 Introduction to Closures 0:45 Key features of Closures 2:07 Syntax of a Closure - A first example 3:37 More examples: Parameters type inferred depending on the type of arguments 6:50 How to capture variables with closures: Capturing by immutably borrowing 8:00 Borrowing a variable mutably with Closures 9:51 Taking ownership of variables with Closures (with drop) 12:28 Closure traits recap: Fn, FnMut, FnOnce 13:03 Closures as function parameters 15:00 Differences between Functions and Closures 17:18 Conclusion GitHub link: https://github.com/FrancescoXX/closures-in-rust