15 releases (3 stable)

1.1.2 Dec 22, 2020
1.1.1 Nov 29, 2020
0.5.0 Aug 5, 2020
0.4.0 Jul 21, 2020
0.1.3 Apr 28, 2020

#35 in Asynchronous

Download history 399/week @ 2020-11-04 441/week @ 2020-11-11 226/week @ 2020-11-18 334/week @ 2020-11-25 117/week @ 2020-12-02 295/week @ 2020-12-09 133/week @ 2020-12-16 19/week @ 2020-12-23 84/week @ 2020-12-30 96/week @ 2021-01-06 195/week @ 2021-01-13 253/week @ 2021-01-20 95/week @ 2021-01-27 199/week @ 2021-02-03 175/week @ 2021-02-10 486/week @ 2021-02-17

1,398 downloads per month
Used in 4 crates

MIT/Apache

6KB

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!");
}

lib.rs:

Attribute macros for smol.

Dependencies

~1.2–1.7MB
~36K SLoC