[![Build Status](https://travis-ci.org/nathan7/fn_box.svg?branch=master)](https://travis-ci.org/nathan7/fn_box) # fn_box Box up your FnOnces! ## API ```rust trait FnBox { extern "rust-call" fn call_box(self: Box, args: Args) -> Result; } impl FnBox for F where F: FnOnce { … } #[cfg(not(when_coherence_is_fixed))] impl<'a> FnOnce() for Box { … } #[cfg(when_coherence_is_fixed)] impl<'a, Args, Result> FnOnce for Box + 'a> { … } ``` ## Usage ```rust let hello: Box = Box::new(move || { println!("hello world!") }); hello(); let plus_one: Box _> = Box::new(move |x: i32| { x + 1 }); assert_eq!(plus_one.call_box((3,)), 4); ```