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
Download history 322/week @ 2024-07-26 567/week @ 2024-08-02 577/week @ 2024-08-09 584/week @ 2024-08-16 820/week @ 2024-08-23 784/week @ 2024-08-30 835/week @ 2024-09-06 504/week @ 2024-09-13 591/week @ 2024-09-20 578/week @ 2024-09-27 447/week @ 2024-10-04 925/week @ 2024-10-11 793/week @ 2024-10-18 706/week @ 2024-10-25 1212/week @ 2024-11-01 316/week @ 2024-11-08

3,225 downloads per month
Used in 18 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
~37K SLoC