error[E0495]: cannot infer an appropriate lifetime for lifetime parameter in function call due to conflicting requirements --> src/main.rs:39:37 | 39 | for item in self.collection.iter() { | ^^^^ | note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the body at 36:90... --> src/main.rs:36:91 | 36 | fn dispatch(&self, input: &'static str) -> Box> { | ^ note: ...so that reference does not outlive borrowed content --> src/main.rs:39:21 | 39 | for item in self.collection.iter() { | ^^^^^^^^^^^^^^^ = note: but, the lifetime must be valid for the static lifetime... note: ...so that the declared lifetime parameter bounds are satisfied --> src/main.rs:49:9 | 49 | Box::new(rx.then(|result| { | _________^ starting here... 50 | | result.expect("receivers cannot produce errors") 51 | | })) as Box> | |_________________________________________________________^ ...ending here