Skip to content

Glossary: Rust Beyond the Basics

capture

Also written: capturing, captures

A closure using a variable from the code around it, such as `discount` using `rate`. By default it borrows the variable; `move` makes it take ownership.

Where the book teaches it

Related terms

closuremove