Skip to content

Instantly share code, notes, and snippets.

@earthengine
Last active January 30, 2019 23:10
Show Gist options
  • Save earthengine/8881ae521e145ae079b0a998dbd2a055 to your computer and use it in GitHub Desktop.
Save earthengine/8881ae521e145ae079b0a998dbd2a055 to your computer and use it in GitHub Desktop.
Ways to make different closures in rust
move keyword State access State copiable Closure type
Yes By val No ClosureOnce
Yes By mut No ClosureUniq
Yes By ref No ClosureRef
Yes By mut* Yes ClosureMutCopy
Yes By val* Yes ClosureCopy
Yes By ref* Yes ClosureCopy
Yes No state N/A Function
No By val No ClosureOnce
No By mut No ClosureUniq
No By ref No ClosureCopy
No By mut* Yes ClosureUniq
No By val* Yes ClosureCopy
No By ref* Yes ClosureCopy
No No state N/A Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment