Loading RustViz Engine...
Demonstrate differences between Fn (shared), FnMut (mutating), and FnOnce (moving captures).
This problem is currently in blueprint template mode. Once the concept foundation is finalized, live in-browser WebAssembly compilation and test assertion runners will be enabled here.
pub fn exec_once<F: FnOnce() -> String>(f: F) -> String { f() }
pub fn exec_mut<F: FnMut(&mut i32)>(mut f: F, val: &mut i32) { f(val); }
pub fn exec_ref<F: Fn(i32) -> i32>(f: F, val: i32) -> i32 { f(val) }