Add proc macro for converting async traits to return StackFutures

未关闭
#5 1 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust
领域
backend

调研方向

首先检查现有的 StackFuture API,以及 issue 中引用的 async_trait crate 行为。明确 proc macro 应如何展开 trait 声明和 impl,包括所需的 lifetime 注解;完成的标准是两种形式都能生成返回具有所请求容量的 StackFuture 的可用方法。

由索引模型根据 Issue 内容生成。

描述

enhancement

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.

主要语言
Rust
星标
314
派生
17
平均合并
11 小时 50 分钟
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/stackfuture 的其他 Issue

查看 microsoft/stackfuture 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。