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

#337 in Asynchronous

Download history 2644/week @ 2023-12-15 2686/week @ 2023-12-22 2766/week @ 2023-12-29 3055/week @ 2024-01-05 2969/week @ 2024-01-12 3800/week @ 2024-01-19 3246/week @ 2024-01-26 3190/week @ 2024-02-02 2836/week @ 2024-02-09 2587/week @ 2024-02-16 2533/week @ 2024-02-23 2646/week @ 2024-03-01 2768/week @ 2024-03-08 2612/week @ 2024-03-15 2790/week @ 2024-03-22 2538/week @ 2024-03-29

11,128 downloads per month
Used in 16 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

~4–16MB
~188K SLoC