Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Rust Closures and Disjoint Capturing - October 2021

Rust via YouTube

Overview

Explore the world of Rust closures in this 35-minute conference talk from Rust Linz, October 2021. Begin with an introduction to closure functionality in Rust, ideal for programmers familiar with closures in other languages. Delve into the syntax of Rust closures, including single-line syntax and type inference. Examine inline closures and function closures, then peek behind the scenes to understand their implementation. Learn about closure lifetimes and explore examples of Fn, FnMut, and FnOnce. Discover the reasons behind FnOnce and conclude with an in-depth look at the new disjoint capturing feature introduced in Rust 2021, illustrated through a "fairy tale" code sample.

Syllabus

Intro
Rust Closures
Syntax
Closure Syntax
Single Line Syntax
Type Inference
Inline Closure
Function Closure
Behind the scenes
Lifetime
Fn Mute Example
Fn Once Example
Why Fn Once
Disjoint Capturing

Taught by

Rust

Reviews

Start your review of Rust Closures and Disjoint Capturing - October 2021

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.