| Crates.io | coroflow |
| lib.rs | coroflow |
| version | 0.1.1 |
| created_at | 2025-12-06 08:05:40.531759+00 |
| updated_at | 2025-12-06 09:38:44.46824+00 |
| description | Composable coroutine utilities and flow abstractions built on top of Rust's async ecosystem |
| homepage | |
| repository | https://github.com/samoylenkodmitry/rs-coroutine-rs-flow |
| max_upload_size | |
| id | 1969808 |
| size | 102,410 |
Composable Flow utilities inspired by Kotlin's Flow API, built on top of rs_coroutine_core for coroutine-style structured concurrency in Rust.
Flow<T> builders that only execute when collected.SharedFlow<T> and StateFlow<T> for broadcasting values.map, filter, take, buffer, flow_on, and flat_map_latest.SuspendingExt::as_flow.Add coroflow and its companion runtime to your Cargo.toml:
[dependencies]
rs_coroutine_core = "0.1.1"
coroflow = "0.1.1"
tokio = { version = "1.35", features = ["full"] }
Create and collect a simple flow with operators:
use coroflow::{flow, FlowExt};
#[tokio::main]
async fn main() {
let numbers = flow(|collector| async move {
for i in 1..=5 {
collector.emit(i).await;
}
});
numbers
.map(|x| async move { x * 2 })
.filter(|x| {
let x = *x;
async move { x > 5 }
})
.collect(|x| async move {
println!("Value: {}", x);
})
.await;
}
For more examples, run cargo run --example basic_usage from the workspace root.
MIT OR Apache-2.0