Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Better approach for statically dispatching async function?
Hello everyone,
I recently discovered the linkme crate, and I find its capabilities to be incredibly compelling.
The ability to statically distribute code at virtually no cost, and with a convenience that rivals dynamic dispatch, is an excellent feature. I have successfully used it to build several small utilities, and I am now hoping to apply it to a more substantial project.
However, I have encountered an unexpected challenge. I had assumed that distributing an async fn
would be as straightforward as a regular fn
. After attempting various approaches, I have come to realise this is not the case. It appears that distributing an async fn
necessitates incurring the overhead associated with dyn
, a limitation I find quite frustrating.
I would be very grateful for any suggestions from the community on this matter. Is there a known method to statically dispatch async fn
with the same convenience that linkme
provides for synchronous functions, but without resorting to the dyn
keyword?
Thank you for your time and assistance.
3 posts - 3 participants
🏷️ Rust_feed