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

Support for traits #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Support for traits #36

wants to merge 1 commit into from

Conversation

a-tal
Copy link

@a-tal a-tal commented Feb 29, 2024

Hey,

First, thanks for the crate, it's great. I'm wondering if it should be able to support trait methods?

Maybe I'm just doing something wrong... and I was able to move things around for now so I can still use this, but I thought I'd put it out there to see if anyone else was running into this issue.

Sorry I haven't looked into macros enough to actually submit a patch, but here's a test case which errors (based on a copy/paste job of the struct tests)

@dcchut
Copy link
Owner

dcchut commented Mar 4, 2024

It should be possible, but this crate was implemented before async fn in traits were stabilized. I'll do some investigations, but in the mean time https://github.com/dtolnay/async-trait (which boxes async trait methods) should allow you to recurse.

Given the overlap, the correct solution may just be adding documentation recommending async-trait for use w/ async fn in traits.

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

Successfully merging this pull request may close these issues.

2 participants