Skip to content

Use actual async fn for traits #4

@deifactor

Description

@deifactor

(First: thanks a ton for the crate, I'm using it in my music player and it's nice not having to think about this stuff myself :) )

Now that async fn in traits has landed in stable Rust, I think it's possible to have the FooInterface traits use that instead of async_trait. If you're fine with an MSRV bump, then this is easy, but if you want to gate them behind a feature flag it gets trickier; features aren't supposed to introduce incompatible changes, so the simple answer of "add a native_async_trait feature that swaps them" doesn't work. You could have a macro_async_trait and native_async_trait features that are incompatible (with the first one enabled by default), or move the "native" ones into a separate submodule. I'm happy to do the actual implementation grunt work, but it's your library so I wanted to leave the design up to you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions