Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proc macro for converting async traits to return StackFutures #5

Open
eholk opened this issue Jul 27, 2022 · 1 comment
Open

Add proc macro for converting async traits to return StackFutures #5

eholk opened this issue Jul 27, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@eholk
Copy link
Contributor

eholk commented Jul 27, 2022

The idea here is to make a macro similar to the #[async_trait] one from the async trait crate. Using it would look something like this:

#[stackfuture::async_trait(4096)]
trait Foo {
    async fn bar(&self) -> i32;
}

The macro would then expand to something like (along with whatever lifetime annotations are needed:

trait Foo {
    fn bar(&self) -> StackFuture<i32, { 4096 }>`;
}

We'd do a similar thing for impls as well.

@eholk eholk added the enhancement New feature or request label Jul 27, 2022
@eholk
Copy link
Contributor Author

eholk commented Sep 13, 2022

I forked async_trait and make a prototype of this here: eholk/stackfuture-async-trait#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant