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

#189 in Asynchronous

Download history 3041/week @ 2022-12-03 2963/week @ 2022-12-10 3615/week @ 2022-12-17 2911/week @ 2022-12-24 2954/week @ 2022-12-31 3670/week @ 2023-01-07 3463/week @ 2023-01-14 3441/week @ 2023-01-21 3569/week @ 2023-01-28 3836/week @ 2023-02-04 3460/week @ 2023-02-11 3555/week @ 2023-02-18 3210/week @ 2023-02-25 3612/week @ 2023-03-04 3915/week @ 2023-03-11 3974/week @ 2023-03-18

15,205 downloads per month
Used in 17 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

~3–8MB
~153K SLoC