smol-potat

Crates.iosmol-potat
lib.rssmol-potat
version1.1.2
sourcesrc
created_at2020-04-23 10:25:12.928252
updated_at2020-12-22 16:13:05.121884
descriptionProc macro for smol runtime.
homepagehttps://github.com/wusyong/smol-potat
repositoryhttps://github.com/wusyong/smol-potat
max_upload_size
id233246
size14,591
Ngo Iok Ui (Wu Yu Wei) (wusyong)

documentation

https://docs.rs/smol-potat

README

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!");
}
Commit count: 46

cargo fmt