Skip to content

Instantly share code, notes, and snippets.

@earthengine
Last active January 30, 2019 23:23
Show Gist options
  • Save earthengine/790e3d6512da5e9debc984d22d927328 to your computer and use it in GitHub Desktop.
Save earthengine/790e3d6512da5e9debc984d22d927328 to your computer and use it in GitHub Desktop.
Rust closures
Name Call mode State mutate Copy Other ability Traits can be implemented Traits implemented
Function Parallel/reentranted No Yes Cast to fn Fn + FnMut + FnOnce + Copy Fn + FnMut + FnOnce + Copy
ClosureMutCopy Parallel/reentranted Yes Yes State snapshot Fn + FnMut(multiple) + FnOnce + Copy FnMut + FnOnce + Copy
ClosureCopy Parallel/reentranted No/Meaningless Yes N/A Fn + FnMut + FnOnce + Copy Fn + FnMut + FnOnce + Copy
ClosureRef Parallel/reentranted No No N/A Fn + FnMut + FnOnce Fn + FnMut + FnOnce
ClosureUniq Sequencial Yes No N/A FnMut + FnOnce FnMut + FnOnce
ClosureOnce Once only Meaningless No N/A FnOnce FnOnce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment