1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! An iterator for `STDIN` and a wrapper for `STDOUT`. Allows easy piping, and
//! graceful closing of application if pipe breaks
//!
//! *Project by [SnS Development](https://gitlab.com/SnSDev)*
//!
//! # Problem
//!
//! Using `STDIN` and `STDOUT` (piping in or piping out) is more complicated
//! than is necessary. The developer should be able to obtain an iterator for
//! the data being piped in through `STDIN`, and should be able to easily pipe
//! out through `STDOUT` any iterator of elements implementing the [std::fmt::Debug] trait.
//!
//! Also, if the `STDOUT` pipe is "broken" (i.e. the data being piped into
//! exits), the iterator being piped out through `STDOUT` should be recoverable
//! so the data can be re-directed. (See Warning in
//! [`prelude::PipeOut::pipe_out`])
//!
//! # Solution
//!
//! - A struct [prelude::PipeInIterator] - An [Iterator] that abstracts the
//! process of piping in through `STDIN`
//! - A trait [prelude::PipeOut] - Implemented on any [Iterator] over elements
//! that implement [std::fmt::Debug] (like [String]) that abstracts the
//! process of piping out through `STDOUT`
//!
//! # Example
//!
//! ```rust,no_run
//! ```
//!
//! # How To: Update Documentation
//!
//! The documentation in this project is contained in the documentation comments
//! throughout the code. Such comments are then compiled into the final
//! documentation for the project via `rustdoc` when the code is published.
//!
//! It is good practice to include a `README.md` file in root folder of the
//! source code for displaying in the respective version management system. In
//! compliance with DRY principle:
//!
//! <blockquote>
//! Every piece of knowledge must have a single, unambiguous, authoritative
//! representation within a system
//!
//! - Src: [Don't repeat yourself - Wikipedia](https://en.wikipedia.org/wiki/Don't_repeat_yourself)
//! </blockquote>
//!
//! and in-order to keep the file from getting out-of-sync with the
//! documentation, I simply duplicate the root page of the documentation via the
//! enclosed script.
//!
//! ## `update_documentation.sh` *Run in the root of project*
//!
//! ```bash
//! ```