Skip to main content

lazyflow_io/
lib.rs

1//! I/O constructors for `lazyflow` -- ergonomic sources and sinks for
2//! files, TCP, and UDP.
3//!
4//! ```ignore
5//! use lazyflow_io::net;
6//!
7//! net::tcp_server("0.0.0.0:8080".parse()?)
8//!     .map(|conn| {
9//!         let (lines, writer) = conn.into_lines();
10//!         lines.eval_map(move |line| {
11//!             let writer = writer.clone();
12//!             async move {
13//!                 writer.write_all(b"hello\n").await?;
14//!                 Ok(line)
15//!             }
16//!         })
17//!     })
18//!     .par_join_unbounded()
19//!     .for_each(|msg| println!("{msg}"))
20//!     .await?;
21//! ```
22
23pub mod file;
24pub mod net;