

I’m not informed on all the details, but a key difference between the async_trait macro and a native async keyword is that async_trait gives you that boxed, trait object type. IIUC the thinking is native support should not automatically box futures, which implies it shouldn’t use dyn either. Using Box and dyn is an easy way to make sure the code works no matter what type of future a method returns. But the trade-off is some runtime overhead from heap allocation (due to Box), and dynamic dispatch (due to dyn).
According to areweasyncyet.rs:
async fn in trait method not stabilized yet
- Workaround is available as an attribute macro: async-trait







It’s a gang. The white house has been making up stories that people they arrest are dangerous gang members, notably including Kilmar Ábrego García.