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

#428 in Asynchronous

Download history 2161/week @ 2024-07-20 2226/week @ 2024-07-27 2426/week @ 2024-08-03 2223/week @ 2024-08-10 2349/week @ 2024-08-17 2920/week @ 2024-08-24 2388/week @ 2024-08-31 2523/week @ 2024-09-07 2220/week @ 2024-09-14 2362/week @ 2024-09-21 2458/week @ 2024-09-28 1979/week @ 2024-10-05 2790/week @ 2024-10-12 2631/week @ 2024-10-19 2549/week @ 2024-10-26 2842/week @ 2024-11-02

11,089 downloads per month
Used in 19 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

~5–17MB
~195K SLoC