Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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.