Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frangio/concat.rs
A reader adaptor that wraps around an iterator of readers and exposes their contents sequentially, i.e. concatenated.
https://github.com/frangio/concat.rs
Last synced: about 1 month ago
JSON representation
A reader adaptor that wraps around an iterator of readers and exposes their contents sequentially, i.e. concatenated.
- Host: GitHub
- URL: https://github.com/frangio/concat.rs
- Owner: frangio
- License: mit
- Created: 2015-05-13T05:11:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-16T22:53:32.000Z (over 9 years ago)
- Last Synced: 2024-04-14T02:10:02.992Z (9 months ago)
- Language: Rust
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# concat.rs
This library provides the Concat reader adaptor, which wraps around an
iterator of readers and exposes its items' contents sequentially. Thus,
the contents read from a Concat instance will be the concatenation of
the items' contents.```rust
fn concat(iter: I) -> Concat where I: Iterator, ::Item: Read
```## Example usage
Assuming there's a variable `files: &mut [File]` in scope
```rust
let mut c = concat(files.iter_mut());
let mut buf = String::new();
c.read_to_string(&mut buf).unwrap();
```## Example program
In the `examples` directory lies a simple (partial) implementation of
coreutils cat using the Concat adaptor.