You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an ergonomics problem for when I have to implement a trait using async_trait when passing JsValues, right now in order to make it work I have to do something like
structMyStruct{db:D1Database}#[worker::send]asyncfndo_foo(value:&MyStruct){// run logic}#[async_trait::async_trait]implSomeAsyncTraitforMyStruct{fnfoo(&self){do_foo(self).await;}}
Where it would be much nicer and more readable to be able to do something like this, which should probably be behind an async_trait feature flag
structMyStruct{db:D1Database}#[async_trait::async_trait]implSomeAsyncTraitforMyStruct{#[worker::trait_send]asyncfnfoo(&self){// run logic}}
I have next to no experience in writing Rust macros, and at a quick glance there's more going on here than I'd be easily able to dig through and understand with my lacking experience, so I hope someone picks this up since we can now easily use axum-login which requires implementing async traits
The text was updated successfully, but these errors were encountered:
Enduriel
changed the title
[Feature] Add #[worker::send] for async_trait
[Feature] Add #[worker::trait_send] for async_trait
Apr 11, 2024
Is there an existing issue for this?
Description
This is an ergonomics problem for when I have to implement a trait using async_trait when passing JsValues, right now in order to make it work I have to do something like
Where it would be much nicer and more readable to be able to do something like this, which should probably be behind an
async_trait
feature flagI have next to no experience in writing Rust macros, and at a quick glance there's more going on here than I'd be easily able to dig through and understand with my lacking experience, so I hope someone picks this up since we can now easily use axum-login which requires implementing async traits
The text was updated successfully, but these errors were encountered: