Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qrichert/tokio-sync2async
Helpers to bridge between sync and async code.
https://github.com/qrichert/tokio-sync2async
async rust rust-library tokio
Last synced: about 1 month ago
JSON representation
Helpers to bridge between sync and async code.
- Host: GitHub
- URL: https://github.com/qrichert/tokio-sync2async
- Owner: qrichert
- Created: 2024-09-01T12:03:59.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-15T09:35:53.000Z (4 months ago)
- Last Synced: 2024-11-20T00:42:37.526Z (about 2 months ago)
- Topics: async, rust, rust-library, tokio
- Language: Rust
- Homepage: https://docs.rs/tokio-sync2async
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tokio-sync2async
[![license: MIT](https://img.shields.io/badge/license-MIT-blue)](https://opensource.org/license/mit)
![GitHub Tag](https://img.shields.io/github/v/tag/qrichert/tokio-sync2async?sort=semver&filter=*.*.*&label=release)
[![crates.io](https://img.shields.io/crates/d/tokio-sync2async?logo=rust&logoColor=white&color=orange)](https://crates.io/crates/tokio-sync2async)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/qrichert/tokio-sync2async/run-tests.yml?label=tests)](https://github.com/qrichert/tokio-sync2async/actions)_Helpers to bridge between sync and async code._
```rust
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
}
```