1pub trait Disposable: Send + 'static { 2 fn dispose(self: Box<Self>); 3} 4 5impl<F> Disposable for F 6where 7 F: FnOnce() + Send + 'static, 8{ 9 fn dispose(self: Box<Self>) { 10 (*self)() 11 } 12}