IO Pipe Library
IO Pipe is a thread-safe Rust library for creating multi-writer and single-reader pipelines. It's ideal for scenarios where you need to write bytes from multiple threads and read them from a single thread.
Features
- Thread-safe communication between writers and readers
- Support for both synchronous and asynchronous operations (via feature flags)
- Easy-to-use API for creating pipes
- Zero dependencies (for core functionality)
Installation
Add this to your Cargo.toml:
[]
= "0.x.x"
For async support, enable the async feature:
[]
= { = "0.x.x", = ["async"] }
Usage
Synchronous API
Single-thread example:
use ;
use pipe;
Multi-thread example:
use ;
use spawn;
use pipe;
Asynchronous API
use async_pipe;
use ;
use block_on;
Documentation
For detailed API documentation, please refer to docs.rs.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Guidelines:
- Use
rustfmtto format your code. - Run
clippyand address any lints before submitting your PR. - Write tests for new functionality.
- Update documentation as necessary.
License
This project is licensed under MIT - see the LICENSE file for details.