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

#26 in #smol

Download history 1088/week @ 2023-12-01 1054/week @ 2023-12-08 865/week @ 2023-12-15 888/week @ 2023-12-22 891/week @ 2023-12-29 1164/week @ 2024-01-05 1114/week @ 2024-01-12 2007/week @ 2024-01-19 1469/week @ 2024-01-26 1354/week @ 2024-02-02 1012/week @ 2024-02-09 764/week @ 2024-02-16 770/week @ 2024-02-23 846/week @ 2024-03-01 896/week @ 2024-03-08 686/week @ 2024-03-15

3,300 downloads per month
Used in 15 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
~34K SLoC