tokio-sync2async

Crates.iotokio-sync2async
lib.rstokio-sync2async
version1.0.0
sourcesrc
created_at2024-09-01 12:15:05.384155
updated_at2024-09-01 12:15:05.384155
descriptionHelpers to bridge between sync and async code.
homepage
repositoryhttps://github.com/qrichert/tokio-sync2async.git
max_upload_size
id1359578
size8,261
Quentin Richert (qrichert)

documentation

README

tokio-sync2async

Helpers to bridge between sync and async code.

use tokio_sync2async::sync_await;

#[tokio::main]
async fn main() {
    sync_fn();
}

fn sync_fn() {
    let res = sync_await(async_fn());
    assert_eq!(res, 42);
}

async fn async_fn() -> i32 {
    42
}
Commit count: 0

cargo fmt