| Crates.io | fnmutant |
| lib.rs | fnmutant |
| version | 0.1.0 |
| created_at | 2020-09-25 13:22:54.331257+00 |
| updated_at | 2020-09-25 13:22:54.331257+00 |
| description | A mutant closure Fn(&mut ...) |
| homepage | |
| repository | https://github.com/ratmice/fnmutant |
| max_upload_size | |
| id | 292834 |
| size | 15,682 |
This (experimental) crate declares a single type FnMutant,
FnMutant has a field f: for<'a> Fn(X) -> Y,
This specifies that the closure must be valid for all lifetimes,
thus any references given to f, through X, must not be captured by the closure.
This results in a function that can be called multiple times (unlike FnOnce),
and does not capture the unique borrow (unlike FnMut).
Because after being called, given an &mut T, the &mut T either been returned or have gone out of scope.