[−][src]Attribute Macro tokio_macros::main
#[main]
Marks async function to be executed by selected runtime.
Options:
single_thread
- Usescurrent_thread
.multi_thread
- Uses multi-threaded runtime. Used by default.
Usage
Select runtime
#[tokio::main(single_thread)] async fn main() { println!("Hello world"); }
Using default
#[tokio::main] async fn main() { println!("Hello world"); }