this post was submitted on 22 Jan 2026
20 points (100.0% liked)
Rust
7695 readers
29 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I'm not informed on all the details, but a key difference between the
async_traitmacro and a native async keyword is thatasync_traitgives you that boxed, trait object type. IIUC the thinking is native support should not automatically box futures, which implies it shouldn't usedyneither. UsingBoxanddynis 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 toBox), and dynamic dispatch (due todyn).According to areweasyncyet.rs: