Brendan Zabarauskas@brendanzabReplying to @KevinHoffman and @rustlangYou might need a higher ranked lifetime: type Callback = dyn for<'a, 'b>Fn(&'a str, &'b [u8]) -> Result<Vec<u8>> + Sync + Send + 'static;12:08 PM · Sep 11, 2019·Twitter Web App
Brendan Zabarauskas@brendanzab·Sep 11, 2019Replying to @brendanzab @KevinHoffman and @rustlangOh wait, I think https://twitter.com/RReverser/status/1171757358898384898… is the right answer. You'll need to do `Box<Callback>` or `&Callback` etc.Quote Tweet extinguished engineer@RReverser · Sep 11, 2019Replying to @KevinHoffman and @rustlangWell it's an unsized type, so like with any unsized type, you need to either store a reference to Callback or a Box<Callback> in your actual struct.1
Brendan Zabarauskas@brendanzab·Sep 11, 2019Playing in the playground Rust it seems to elide the higher ranked lifetimes automatically.