diff options
author | Daniel <kingdread@gmx.de> | 2020-05-13 13:49:43 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2020-05-13 13:49:43 +0200 |
commit | fb2a6088dcc7b57a2c1ac93ec6a8fbcc52584734 (patch) | |
tree | 66979361f60dad90f6c9b0eff7c5bf20404357e8 /src/output/pipeline.rs | |
parent | 331d6b1762d1d9431b210fc98a495d56ad7a1cd1 (diff) | |
download | raidgrep-fb2a6088dcc7b57a2c1ac93ec6a8fbcc52584734.tar.gz raidgrep-fb2a6088dcc7b57a2c1ac93ec6a8fbcc52584734.tar.bz2 raidgrep-fb2a6088dcc7b57a2c1ac93ec6a8fbcc52584734.zip |
first attempt at sorting output
This does currently not work yet, as we cannot call .finish() on dyn
Aggregator. This needs to be adjusted.
However, this provides the basic infrastructure for producing sorted
output, including the required command line parsing.
Diffstat (limited to 'src/output/pipeline.rs')
-rw-r--r-- | src/output/pipeline.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/output/pipeline.rs b/src/output/pipeline.rs index 9664928..9b7f461 100644 --- a/src/output/pipeline.rs +++ b/src/output/pipeline.rs @@ -22,8 +22,13 @@ impl Pipeline { } } - pub fn push_item(&self, item: &LogResult) { + pub fn push_item(&self, item: LogResult) { let mut writer = self.writer.lock().unwrap(); self.aggregator.push_item(item, &*self.format, &mut *writer); } + + pub fn finish(self) { + let mut writer = self.writer.lock().unwrap(); + self.aggregator.finish(&*self.format, &mut *writer); + } } |