I am fighting with dyn Trait to get a vector of different types...
When the code is sync, it compiles without any problem, but when I switch to async code, it fails.
I don't want to use an enum and I don't want to move function to another trait: is it possible ?
Your code works if you use the #[async_trait] macro from the async-trait crate (GitHub - dtolnay/async-trait: Type erasure for async trait methods), which creates traits that work with dyn Trait. Using async fn inside traits without this macro, they do not work with dyn Trait.