4 releases (breaking)

0.6.0 Dec 22, 2020
0.5.0 Nov 6, 2020
0.3.0 Aug 5, 2020
0.2.0 Jul 21, 2020

#32 in #smol

Download history 1548/week @ 2024-04-03 1192/week @ 2024-04-10 1141/week @ 2024-04-17 979/week @ 2024-04-24 1589/week @ 2024-05-01 1338/week @ 2024-05-08 733/week @ 2024-05-15 664/week @ 2024-05-22 626/week @ 2024-05-29 675/week @ 2024-06-05 433/week @ 2024-06-12 467/week @ 2024-06-19 327/week @ 2024-06-26 676/week @ 2024-07-03 861/week @ 2024-07-10 586/week @ 2024-07-17

2,521 downloads per month
Used in 17 crates (via smol-potat)

MIT/Apache

11KB
209 lines

smol-potat

Proc macro for smol runtime.

This is the macro to help you initializing smol runtime on your binary, test cases and benchmark. Usage is similar to what you do in tokio and async-std.

Usage

Single thread

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

Multi threads

#[smol_potat::main(threads=3)]
async fn main() {
    println!("Hello, world!");
}

Auto thread generation

Enable auto feature and the rest is same as single thread:

smol_potat = { version = "1", features = ["auto"] }
#[smol_potat::main]
async fn main() {
    println!("Hello, world!");
}

Dependencies

~1.5MB
~35K SLoC