teohhanhui / smol-potat

Proc macro for smol async runtime

Home Page:https://crates.io/crates/smol-potat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Proc macro for smol async runtime

https://crates.io/crates/smol-potat


Languages

Language:Rust 100.0%