How to fix: value may contain references; add `'static` bound to `T`
问题 I managed yet again to run into a lifetime issue that I seem to be unable to solve on my own. I have this trait pub trait MiddlewareHandler: Clone { fn invoke (&self, req: &Request, res: &mut Response) -> bool { true } // we need this because otherwise clone() would be ambiguous fn clone_box(&self) -> Box<MiddlewareHandler> { box self.clone() as Box<MiddlewareHandler> } } impl MiddlewareHandler for fn (req: &Request, res: &mut Response) -> bool { fn invoke(&self, req: &Request, res: &mut