I have a trait where I have to use #[async_trait(?Send)] because of some methods and data structures they return, but at the same time I want boxed future to be Send when returned from other methods.
Do you think it would be valuable to have an additional per-method attribute that would add + Send?
It is possible to work around by writing a method that returns Pin<Box<dyn Future<Output = ()> + Send + '_>> manually, but cleaner approach would be beneficial I think.
I would prefer not to build this into this crate. But it would be reasonable for somebody else to maintain a more fully featured macro for async traits that handles this use case.
I have a trait where I have to use
#[async_trait(?Send)]
because of some methods and data structures they return, but at the same time I want boxed future to beSend
when returned from other methods.Do you think it would be valuable to have an additional per-method attribute that would add
+ Send
?It is possible to work around by writing a method that returns
Pin<Box<dyn Future<Output = ()> + Send + '_>>
manually, but cleaner approach would be beneficial I think.