Skip to content

Provide a Shorthand for adding Send bounds #18

Open
@shadowcpy

Description

@shadowcpy

Hey everyone,

it would be great if we could have a shorthand for making a trait Send only, like this:

#[trait_variant::only_send]
pub trait SomeTrait {
  async fn hello() -> i32;
}

desugaring to

pub trait SomeTrait: Send {
  fn hello() -> impl Future<Output = i32> + Send;
}

(no second variant)

The rationale behind it being that with the mostly Multithreaded Executors that are used widely right now (like tokio), this will probably be the default case once AFIT is becoming stable on 28th.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions