Crate async_main

source ·
Expand description

Runtime-agnostic async main proc macro. Currently, this crate only supports single-threaded task pools, but in a future version will add a configuration option to enable multi-threaded task pools.

Getting Started

Choose a runtime by enabling one of the following features:

  • async-executor
  • async-std
  • futures
  • pasts
  • tokio
use async_main::{async_main, LocalSpawner};

#[async_main]
async fn main(_spawner: LocalSpawner) {
    println!("Hello, world!");
}

Structs

Traits

  • Implementation for spawning tasks on an executor.

Attribute Macros