fnmutant

Crates.iofnmutant
lib.rsfnmutant
version0.1.0
sourcesrc
created_at2020-09-25 13:22:54.331257
updated_at2020-09-25 13:22:54.331257
descriptionA mutant closure Fn(&mut ...)
homepage
repositoryhttps://github.com/ratmice/fnmutant
max_upload_size
id292834
size15,682
matt rice (ratmice)

documentation

README

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.

Commit count: 2

cargo fmt