The streams returned by stream!/try_stream contain opaque types (impl trait), so they are treated as different types even if the signatures are the same.
There are a few ways to handle such cases:
Boxing. However, when boxing futures, streams, etc., you need to use Box::pin instead of Box::new.
Will complain that
a
andb
have incompatible types:distinct uses of "impl Trait" result in different opaque types
Boxing them will make me unable to pin them going forward, so what should be the way forward here?